[fpc-devel] GetAppConfigFile implementation
Michael Van Canneyt
michael at freepascal.org
Sat Dec 20 12:48:22 CET 2008
On Sat, 20 Dec 2008, Vincent Snijders wrote:
> Felipe Monteiro de Carvalho schreef:
> > Hello,
> >
> > GetAppConfigFile in win32 uses CSIDL_LOCAL_APPDATA to be implemented.
> >
> > I did some research, and I think that CSIDL_APPDATA is a better choice:
> >
> > http://blogs.msdn.com/oldnewthing/archive/2005/07/01/434647.aspx
> >
> > They are very similar, but the LOCAL version is a bit more specifc,
> > and the non-LOCAL has the advantage of a lower requirement. It
> > requires shell 4.0 while the other requires shell 5.0
> >
> > Careful that both are for local settings, the name just isn't very
> > intuitive.
>
> I thought that local version is not stored on the network and is not available
> in the roaming profile. Putting a 100 MB Lazarus exe in the CSIDL_APPDATA is
> not a good thing, it ruins startup time (and shutdown time to copy the 100 MB
> to the network). So, if this change is made, I will probably put windows
> specific code in Lazarus to prevent that.
I specially chose local because I don't want it to be roaming data.
I don't intend to change the implementation, if only for backward
compatibility: suddenly all config files would no longer be found.
And frankly, with each new version of Windows, there are new folders and
rules, so we can keep playing catch-up.
That aside, I think we should maybe create a unit 'osfolders' or so
which creates a cross-platform interface to retrieve 'special' folders
in a cross-platform way, using some enumerated type. I have made this
once for Delphi, to hide the ugly windows API in something more Pascal-ish.
Extending it to work on Unices as well should not be too hard.
I'll put it on my todo list.
Michael.
More information about the fpc-devel
mailing list