[Lazarus] Lazarus config woes

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Apr 1 05:46:30 CEST 2011

Mattias Gaertner schrieb:

>  > Searching for config files in the exe dir (even if done) doesn't solve
>  > the first issue, as there may not be any config files in that directory
>  > to start with.
> Then the IDE creates defaults.

Where is that default config created, in the primary or secondary config 

> Since 0.9.29 packages in the Lazarus directory are stored relative. 
> Changing the Lazarus directory will load the lpk files of the new 
> Lazarus directory.

Ah! :-)

Does it really make sense to use a Lazarus directory, different from the 
one the IDE was built from?

If not, the build-path could be stored in the IDE, so that the Lazarus 
Directory must not normally be specified, and the IDE can use the 
correct directory automatically (variation of the EXE directory approach).

A bit more detailed: the Lazarus Directory (in the config) could be made 
automatic, by adding a checkbox "Use this Lazarus directory". When 
unchecked, the IDE uses the Lazarus directory from which it was built 
(and shows the selected path in the options dialog). In the rare cases 
where the Lazarus directory has been moved, this option can be used to 
specify the new directory, to be used in the next IDE rebuild.

The checkbox could be initialized automatically, to unchecked when a 
valid config was found, and to checked when an invalid config was 
detected. No need to store this new option in the config.

> I added a check for the ide/version.inc.
> Configs from another version are quietly loaded and updated.

What exactly is updated?
(also see above suggestion)

Does this update permanently affect the stored config?

> Maybe a check could be added to warn if the environmentoptions.xml is 
> from a future Lazarus with two options: Quit and continue.

This problem suggests to use versioned configs, at least in the default 
config location, using the ide/version.inc. Then the config also could 
be splitted, into an common part in the config root directory itself 
(user preferences), and extensions or otherwise config/build specific 
settings in the version subdirectories.

>  > IMHO for example any error about installed/not found packages at start
>  > up, could also offer to run the setup dialog again (and point out which
>  > config is used / warn about a potential conflict)
> Yes.

IMO such a repair feature should be built into the IDE, so that it can 
be used even without an installer (which might be unavailable or may 
repeat the wrong initial configuring). It might become part of the 
startlazarus application as well...


More information about the Lazarus mailing list