Show quoted text 17 lines
Am 07.03.2012 19:11, schrieb Mark Morgan Lloyd:
> Sven Barth wrote:
>
>>> A further question Mattias, if I just run the individual lazarus.exe
>>> file in it's corresponding directory, I presume that would also be fine.
>>> Although, I appreciate that I would have 2 completely seperate sets of
>>> settings.
>>
>> Without any parameters the settings are saved in %APPDATA%, so any
>> Lazarus would use/overwrite the settings of the other Lazarus. You
>> MUST pass the pcp parameter to all installations if you want different
>> configurations (Note: You can leave out the parameter for one
>> installation which will then use the default location).
>
> When Lazarus reads the config file, what is the current directory (i.e.
> . in unix and Windows)? Could this be used to specify the same location
> as the binary?
Yes, you can start it with
./lazarus --pcp=config
Or under Windows:
startlazarus --pcp=config
Show quoted text 5 lines
I don't know whether Lazarus does a "SetCurrentDir", but in Unix it will
be the directory you started it from (if from the shell) or some other
directory if started through the desktop manager (I don't know which
methods are used there, I'd even need to check what wmii - which is the
WM I use - does there ^^).
It depends.
Desktop shortcuts under Linux have an entry for the working directory. Similar as under Windows.
Show quoted text 7 lines
On Windows it will be the directory specified
in the shortcut (if started from a shortcut) or the current directory
(if started through cmd or by clicking the exe).
My opinion: don't rely on the current directory if you want to locate
configuration. In theory the approach "ExtractFilePath(ParamStr(0))"
could be used, but there can be problems on Unix systems with that.
Yes, because of bundles, symlinks and shell extensions. The ParamStr(0) is what the user input (e.g. ~/dir/lazarus), not what file was executed.
Mattias