[Lazarus] Multiple installations of Lazarus

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Mar 8 10:24:40 CET 2012


On Thu, 08 Mar 2012 09:59:32 +0100
Sven Barth <pascaldragon at googlemail.com> wrote:

> 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

 
> 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.


> 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




More information about the Lazarus mailing list