Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-12

GetAppConfigFile implementation

8 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

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.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 13 lines
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.

Vincent

Reply by email

Michael Van Canneyt
to Vincent Snijders
Vincent Snijders wrote 21 lines
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.

Reply by email

Luca Olivetti
to Vincent Snijders: I thought that local version is not stored on the network and is not available in the…

En/na Vincent Snijders ha escrit:

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

Well, I don't think that an executable is configuration data, so no matter what, it's wrong to put it either in CSIDL_APPDATA or CSIDL_LOCAL_APPDATA.
Anyway, I told various times that GetAppConfigFile should return CSIDL_APPDATA, CSIDL_LOCAL_APPDATA should be used only for really local things (e.g. a browser cache).

Bye

Luca

Reply by email

Zaher Dirkey
to Luca Olivetti

I have external hard disk (USB) and use it in both work and my home, put every thing on it, the problem after Lazarus using that AppData folder i lost between home and work, is any way to change Lazarus config folder to special folder (i will point to my usb hard).

Luca Olivetti wrote 20 lines
En/na Vincent Snijders ha escrit: > > 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 Well, I don't think that an executable is configuration data, so no matter what, it's wrong to put it either in CSIDL_APPDATA or CSIDL_LOCAL_APPDATA. Anyway, I told various times that GetAppConfigFile should return CSIDL_APPDATA, CSIDL_LOCAL_APPDATA should be used only for really local things (e.g. a browser cache). Bye -- Luca _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
Zaher Dirkey

Reply by email

Vincent Snijders
to Zaher Dirkey
Zaher Dirkey wrote 5 lines
I have external hard disk (USB) and use it in both work and my home, put every thing on it, the problem after Lazarus using that AppData folder i lost between home and work, is any way to change Lazarus config folder to special folder (i will point to my usb hard).

Yes, use the --pcp=x:\lazarus\config command line parameter to set the primary config directory.

Vincent

Reply by email

Alexander Klenin
to Michael Van Canneyt: I specially chose local because I don't want it to be roaming data. I don't intend to…
Michael Van Canneyt wrote
I specially chose local because I don't want it to be roaming data.

This is actually a (minor) problem sometimes -- e.g. students at unversity where I work have roaming profiles so the could log in and work prom any PC in the domain.
With config in local appdata, they are forced to re-configure IDE on each session.

As a related note, I have more serious problem with Lazarus config: on my PC (Windows XP SP2 Russian) Larazus insists on saving it in "C:\Documents", although APPDATA=C:\Documents and Settings\ask\Application Data Apparently, it chokes on long names with spaces.

Alexander S. Klenin

Reply by email

Carolos
to Alexander Klenin

How about if Lazarus is in the Program Files directory, it searches AppData first.
If not it searches it's directory first then AppData.

Alexander Klenin wrote 22 lines
On Sat, Dec 20, 2008 at 21:48, Michael Van Canneyt wrote: > I specially chose local because I don't want it to be roaming data. This is actually a (minor) problem sometimes -- e.g. students at unversity where I work have roaming profiles so the could log in and work prom any PC in the domain. With config in local appdata, they are forced to re-configure IDE on each session. As a related note, I have more serious problem with Lazarus config: on my PC (Windows XP SP2 Russian) Larazus insists on saving it in "C:\Documents", although APPDATA=C:\Documents and Settings\ask\Application Data Apparently, it chokes on long names with spaces. -- Alexander S. Klenin _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email