[Lazarus] Lazarus config woes

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sun Apr 3 11:57:48 CEST 2011

Mattias Gaertner schrieb:

>>>> BTW, my experiments indicate that putting an environmentoptions.xml into 
>>>> the Lazarus directory (scp) will make the IDE use these settings, but 
>>>> only if there exists no config in the default location. The full config 
>>>> then is written back to the *default* location (pcp), not into the 
>>>> Lazarus directory.
>>> Yes, that's what I meant with used as template.
>> Okay, that explains a lot :-)
>> Remains to mention that the "template" term has to be explained to the 
>> user. Normally a template is used to create *different* versions 
>> (installations) from it, but Lazarus - by default - does it the opposite 
>> way: templates are taken from an *installation*, and the result is put 
>> into a *common* place.
> It seems to me you misunderstood.
> It is taken from the installation (e.g. under Linux the scp
> is /etc/lazarus). The Windows installer puts the files into the Lazarus
> directory, which can be a system wide directory, not writable for the
> user.
> And put into a user specific place. Under Linux this is ~/.lazarus,
> under Windows it is GetAppConfigDir(False).

Exactly as I wrote: a new installation copies its config files 
(templates) from the Lazarus directory into the common config directory.

I accept the argument, that the Lazarus directory may be write 
protected, so that the new config may have to be stored in user-land. 
And I accept that typical installs of new versions, of the same 
application, should update the common application config.

But this IMO is what an *installer* should do, the IDE itself should 
behave differently, to better support *multiple* installations. In fact 
the Windows installer creates a rudimentary environmentoptions.xml, that 
only contains the absolute references to the applications (fpc, make) 
that come with the installation. The behaviour on Linux may be 
different, AFAIK Linux installations don't include their own FPC and tools.

We still seem to differ in the meaning of "template". You mean 
installation-specific settings, like the pathes to the tools that came 
with a new installation. Instead I mean all the other settings, which 
the user has used before (e.g. language, window positions...).

Unfortunately both sets of settings are stored in the same file, 
environmentoptions.xml, so that *all* user-specific settings in that 
file are lost, when a new config is created by the IDE in the given -pcp :-(

>> This behaviour makes sense only because -pcp overwrites the *common* 
>> place, so that effectively *no* place exists where common 
>> (installation-independent) templates or settings can be stored :-(
> Your information is outdated.

No, my tests are based on both 0.9.30 release and trunk.

> Please take a look at ide/include/win/lazbaseconf.inc. You can see that
> only for fpc 2.2.0 the scp was the same as the pcp.

You better test the real behaviour of the IDE, as I did. Then you may 
understand better what I wrote.

>> [...]
>>>> Why does the IDE store an updated config *always* in the default 
>>>> directory, instead in the same directory from which (parts of) the 
>>>> config have been loaded before?
>>> If you want that you can set pcp and scp to the same directory.
>> That's not a solution of the problem, because then still no place 
>> exists, where defaults could be stored - they are overwritten when 
>> pcp=scp :-(
> I can't follow you here. Maybe you are talking about a different kind of
> "defaults"? The purpose of the scp is to provide defaults for the first
> start of the IDE.

See above. The current contents of a "template" are the 
*installation-specific* pathes, that apply to a concrete installation. 
In so far it makes sense to copy *these* values from the scp, i.e. from 
the Lazarus directory. But then we should have another kind of 
templates, that contain all the remaining settings, AKA *user preferences*.

Perhaps you'll better understand my point when you try to configure a 
new SVN checkout, based on the current user-specific settings. How can 
this be accomplished?

In a more perfect world we would have:
- user config path (ucp, my templates, default: common config place)
- installation config path (scp, your templates, default: LazDir)
- primary config path (pcp, as is, default: [SVN] working copy)


More information about the Lazarus mailing list