mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 09:39:09 +02:00
* ide makes use of %APPDATA% if available to store configuration files, same logic as on unix, resolves #20870
git-svn-id: trunk@19929 -
This commit is contained in:
parent
a231396bf7
commit
25e38983cf
@ -31,7 +31,7 @@ procedure SetPrinterDevice(const Device: string);
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Dos,Objects,Drivers,
|
Dos,Objects,Drivers,
|
||||||
FVConsts,
|
FVConsts,
|
||||||
Version,
|
Version,
|
||||||
@ -151,6 +151,24 @@ begin
|
|||||||
StartupDir:=CompleteDir(FExpand('.'));
|
StartupDir:=CompleteDir(FExpand('.'));
|
||||||
{$ifndef unix}
|
{$ifndef unix}
|
||||||
IDEDir:=CompleteDir(DirOf(system.Paramstr(0)));
|
IDEDir:=CompleteDir(DirOf(system.Paramstr(0)));
|
||||||
|
{$ifdef WINDOWS}
|
||||||
|
SystemIDEDir:=IDEDir;
|
||||||
|
if GetEnv('APPDATA')<>'' then
|
||||||
|
begin
|
||||||
|
IDEdir:=CompleteDir(FExpand(GetEnv('APPDATA')+'/fp'));
|
||||||
|
If Not ExistsDir(IDEdir) Then
|
||||||
|
begin
|
||||||
|
IDEDir:=SystemIDEDir;
|
||||||
|
if Not ExistsDir(IDEDir) then
|
||||||
|
begin
|
||||||
|
if DirOf(system.paramstr(0))<>'' then
|
||||||
|
IDEDir:=CompleteDir(DirOf(system.ParamStr(0)))
|
||||||
|
else
|
||||||
|
IDEDir:=StartupDir;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$endif WINDOWS}
|
||||||
{$else}
|
{$else}
|
||||||
SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide/text');
|
SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide/text');
|
||||||
If Not ExistsDir(SystemIDEdir) Then
|
If Not ExistsDir(SystemIDEdir) Then
|
||||||
@ -560,6 +578,15 @@ begin
|
|||||||
MkDir(FExpand('~/.fp'));
|
MkDir(FExpand('~/.fp'));
|
||||||
end;
|
end;
|
||||||
{$endif Unix}
|
{$endif Unix}
|
||||||
|
{$ifdef WINDOWS}
|
||||||
|
if not FromSaveAs and (DirOf(IniFileName)=DirOf(SystemIDEDir)) and
|
||||||
|
(GetEnv('APPDATA')<>'') then
|
||||||
|
begin
|
||||||
|
IniFileName:=FExpand(GetEnv('APPDATA')+'/fp/'+IniName);
|
||||||
|
If not ExistsDir(DirOf(IniFileName)) then
|
||||||
|
MkDir(FExpand(GetEnv('APPDATA')+'/fp'));
|
||||||
|
end;
|
||||||
|
{$endif WINDOWS}
|
||||||
New(INIFile, Init(IniFileName));
|
New(INIFile, Init(IniFileName));
|
||||||
{ Files }
|
{ Files }
|
||||||
{ avoid keeping old files }
|
{ avoid keeping old files }
|
||||||
|
@ -90,9 +90,9 @@ const ClipboardWindow : PClipboardWindow = nil;
|
|||||||
ShowStatusOnError: boolean = true;
|
ShowStatusOnError: boolean = true;
|
||||||
StartupDir : string = '.'+DirSep;
|
StartupDir : string = '.'+DirSep;
|
||||||
IDEDir : string = '.'+DirSep;
|
IDEDir : string = '.'+DirSep;
|
||||||
{$ifdef Unix}
|
{$if defined(WINDOWS) or defined(Unix)}
|
||||||
SystemIDEDir : string = '';
|
SystemIDEDir : string = '';
|
||||||
{$endif Unix}
|
{$endif defined(WINDOWS) or defined(Unix)}
|
||||||
INIFileName : string = ININame;
|
INIFileName : string = ININame;
|
||||||
SwitchesPath : string = SwitchesName;
|
SwitchesPath : string = SwitchesName;
|
||||||
CtrlMouseAction : integer = acTopicSearch;
|
CtrlMouseAction : integer = acTopicSearch;
|
||||||
|
Loading…
Reference in New Issue
Block a user