Re: [fpc-devel] GetAppConfigFile implementation

2008-12-22 Thread Zaher Dirkey
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).

On Sat, Dec 20, 2008 at 3:48 PM, Luca Olivetti l...@ventoso.org wrote:
 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  -  fpc-devel@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-devel




-- 
Zaher Dirkey
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile implementation

2008-12-22 Thread Vincent Snijders

Zaher Dirkey schreef:

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
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile implementation

2008-12-22 Thread Alexander Klenin
On Sat, Dec 20, 2008 at 21:48, Michael Van Canneyt
mich...@freepascal.org 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  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile implementation

2008-12-22 Thread Carolos
How about if Lazarus is in the Program Files directory, it searches AppData
first.
If not it searches it's directory first then AppData.

On Mon, Dec 22, 2008 at 4:28 PM, Alexander Klenin kle...@gmail.com wrote:

 On Sat, Dec 20, 2008 at 21:48, Michael Van Canneyt
 mich...@freepascal.org 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  -  fpc-devel@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-devel

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] GetAppConfigFile implementation

2008-12-20 Thread 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
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile implementation

2008-12-20 Thread Vincent Snijders

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.


Vincent
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile implementation

2008-12-20 Thread Michael Van Canneyt


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.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile implementation

2008-12-20 Thread Luca Olivetti

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  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] GetAppConfigFile

2008-10-04 Thread Micha Nelissen

Hi,

Why is there a parameter to GetAppConfigFile? I'd suggest something like:

function GetAppConfigFile: string;
begin
  { first look for user specific config file }
  Result := GetAppConfigFile(false);
  if FileExists(Result) then
exit;
  { otherwise use global one }
  Result := GetAppConfigFile(true);
end;

This would first look for the user version, then for the global variant.

(BTW: instead of Boolean, I would have liked a acLocal, acGlobal better, 
it's clearer to read).


Any thoughts?

Micha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile

2008-10-04 Thread Aleš Katona
Dňa So, 2008-10-04 o 12:23 +0200, Micha Nelissen napísal:
 Hi,
 
 Why is there a parameter to GetAppConfigFile? I'd suggest something like:
 
 function GetAppConfigFile: string;
 begin
{ first look for user specific config file }
Result := GetAppConfigFile(false);
if FileExists(Result) then
  exit;
{ otherwise use global one }
Result := GetAppConfigFile(true);
 end;
 
 This would first look for the user version, then for the global variant.
 
 (BTW: instead of Boolean, I would have liked a acLocal, acGlobal better, 
 it's clearer to read).
 
 Any thoughts?

Please don't break this yet again. It's bad enough FPC completely ruined
config dir paths on some OSes between versions as is.

I don't see a particular problem with the boolean var.

Ales
 
 Micha
 ___
 fpc-devel maillist  -  fpc-devel@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-devel

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile

2008-10-04 Thread Luca Olivetti

En/na Vinzent Höfler ha escrit:

Agreed. But it's as it is, I guess. It was broken so often, can't do 
that again... ;)


I think it's still broken, at least under windows (for roaming profiles 
to work it should return CSIDL_APPDATA and not CSIDL_LOCAL_APPDATA), but 
I guess that's a matter of opinion.


Bye
--
Luca


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile

2008-10-04 Thread Vinzent Höfler

Micha Nelissen wrote:

Vinzent Höfler wrote:
Often, after a first install, the local config does not exist yet (or 
the user may have deleted it), so your proposed approach would 
completely disable the local config then, because without the proper 


No, when saving you always save to the local config file, because most 
of the time you're not allowed to write to the global one.


Yes, but your proposal would never return the file name of a local 
config if it doesn't exist in the first place, so how would an 
application find out where it's supposed to create it?



Loading is more common than saving, that's the use case I am talking about.


Well, and that use case usually involves loading *both* files, first the 
global settings and then optionally tweaking it with a user specific 
configuration. For those cases your approach wouldn't work neither.



Vinzent.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile

2008-10-04 Thread Felipe Monteiro de Carvalho
The parameter exists to choose if you wish the local or global config file.

Please don't change this.

-- 
Felipe Monteiro de Carvalho
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] GetAppConfigFile() output issue

2007-09-12 Thread Graeme Geldenhuys
Hi

I created a simple console application that executes the following commands...


  writeln('GetAppConfigDir(False);');
  writeln('   ' + GetAppConfigDir(False));
  writeln('GetAppConfigFile(False);');
  writeln('   ' + GetAppConfigFile(False));
  writeln('ApplicationName');
  writeln('   ' + ApplicationName);


Below is the output on Windows and Linux.  I think there is a
inconsistency between the output for GetAppConfigFile(False) under
both platforms.

I assume 'Application Data' under Windows is equivalent to '.config'
under Linux. If so then...

Under Windows it includes a directory equivalent to the application
name or GetAppConfigDir(False) and then the *.cfg file.

Under Linux in contains one directory less. The directory equivalent
to the application name is missing.

Is this a oversight or by design?



---  Windows 2000  -
GetAppConfigDir(False);

   C:\Documents and Settings\Graeme\Local Settings\Application Data\project1

GetAppConfigFile(False);

   C:\Documents and Settings\Graeme\Local Settings\Application
Data\project1\project1.cfg

ApplicationName

   project1




---   Linux  ---
GetAppConfigDir(False);
   /home/graemeg/.config/project1
GetAppConfigFile(False);
   /home/graemeg/.config/project1.cfg
ApplicationName
   project1



Regards,
  - Graeme -
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetAppConfigFile() output issue

2007-09-12 Thread Graeme Geldenhuys
On 12/09/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:
  Is this a oversight or by design?

 This is by design.

 The Free Desktop Project's recommendations were used for the current
 implementation.

 I assume that for symmetry reasons, you would like to see it the same in
 both ? :-)


:-) It's easy to work around this difference - though no need to
really.  I just wanted to confirm that it was by design.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel