|
@@ -19,8 +19,11 @@ interface
|
|
|
uses Classes, Sysutils, Inifiles, fprepos;
|
|
|
|
|
|
Const
|
|
|
- DefaultManifestFile = 'manifest.xml';
|
|
|
- CurrentConfigVersion = '0.1';
|
|
|
+ ManifestFileName = 'manifest.xml';
|
|
|
+ MirrorsFileName = 'mirrors.xml';
|
|
|
+ PackagesFileName = 'packages.xml';
|
|
|
+ VersionsFileName = 'versions-%s.dat';
|
|
|
+ CurrentConfigVersion = 2;
|
|
|
|
|
|
Type
|
|
|
|
|
@@ -29,15 +32,13 @@ Type
|
|
|
TGlobalOptions = Class(TPersistent)
|
|
|
private
|
|
|
FDirty : Boolean;
|
|
|
- FConfigVersion,
|
|
|
- FRemoteMirrorsLocation,
|
|
|
- FLocalMirrorsLocation,
|
|
|
+ FConfigVersion : Integer;
|
|
|
+ FRemoteMirrorsURL,
|
|
|
FRemoteRepository,
|
|
|
FLocalRepository,
|
|
|
FCompilerConfigDir,
|
|
|
FPackagesDir,
|
|
|
FBuildDir,
|
|
|
- FDefaultVerbosity,
|
|
|
FDownloader,
|
|
|
FDefaultCompilerConfig,
|
|
|
FFPMakeCompilerConfig : String;
|
|
@@ -49,24 +50,21 @@ Type
|
|
|
Public
|
|
|
Constructor Create;
|
|
|
Procedure InitGlobalDefaults;
|
|
|
- Procedure LoadGlobalFromIni(Ini : TCustomIniFile); virtual;
|
|
|
- Procedure SaveGlobalToIni(Ini : TCustomIniFile); virtual;
|
|
|
Procedure LoadGlobalFromFile(const AFileName : String);
|
|
|
Procedure SaveGlobalToFile(const AFileName : String);
|
|
|
Property Dirty : Boolean Read FDirty;
|
|
|
- Property ConfigVersion : String read FConfigVersion;
|
|
|
- function RemotePackagesFile:string;
|
|
|
+ Property ConfigVersion : Integer read FConfigVersion;
|
|
|
function LocalPackagesFile:string;
|
|
|
+ function LocalMirrorsFile:string;
|
|
|
function LocalVersionsFile(const ACompilerConfig:String):string;
|
|
|
Published
|
|
|
- Property RemoteMirrorsLocation : String Index 0 Read GetOptString Write SetOptString;
|
|
|
- Property LocalMirrorsLocation : String Index 1 Read GetOptString Write SetOptString;
|
|
|
+ Property RemoteMirrorsURL : String Index 0 Read GetOptString Write SetOptString;
|
|
|
+ // 1 is unused
|
|
|
Property RemoteRepository : String Index 2 Read GetOptString Write SetOptString;
|
|
|
Property LocalRepository : String Index 3 Read GetOptString Write SetOptString;
|
|
|
Property BuildDir : String Index 4 Read GetOptString Write SetOptString;
|
|
|
Property PackagesDir : String Index 5 Read GetOptString Write SetOptString;
|
|
|
Property CompilerConfigDir : String Index 6 Read GetOptString Write SetOptString;
|
|
|
- Property DefaultVerbosity : String Index 7 Read GetOptString Write SetOptString;
|
|
|
Property DefaultCompilerConfig : String Index 8 Read GetOptString Write SetOptString;
|
|
|
Property FPMakeCompilerConfig : String Index 9 Read GetOptString Write SetOptString;
|
|
|
Property Downloader: String Index 10 Read GetOptString Write SetOptString;
|
|
@@ -81,7 +79,7 @@ Type
|
|
|
TCompilerOptions = Class(TPersistent)
|
|
|
private
|
|
|
FDirty: Boolean;
|
|
|
- FConfigVersion,
|
|
|
+ FConfigVersion : Integer;
|
|
|
FCompiler,
|
|
|
FCompilerVersion,
|
|
|
FLocalInstallDir,
|
|
@@ -95,12 +93,10 @@ Type
|
|
|
Public
|
|
|
Constructor Create;
|
|
|
Procedure InitCompilerDefaults;
|
|
|
- Procedure LoadCompilerFromIni(Ini : TCustomIniFile); virtual;
|
|
|
- Procedure SaveCompilerToIni(Ini : TCustomIniFile); virtual;
|
|
|
Procedure LoadCompilerFromFile(const AFileName : String);
|
|
|
Procedure SaveCompilerToFile(const AFileName : String);
|
|
|
Property Dirty : Boolean Read FDirty;
|
|
|
- Property ConfigVersion : String read FConfigVersion;
|
|
|
+ Property ConfigVersion : Integer read FConfigVersion;
|
|
|
Function LocalUnitDir:string;
|
|
|
Function GlobalUnitDir:string;
|
|
|
Published
|
|
@@ -126,15 +122,11 @@ uses
|
|
|
pkgmessages;
|
|
|
|
|
|
Const
|
|
|
- DefaultMirrorFile = 'mirrors.xml';
|
|
|
- DefaultPackagesFile = 'packages.xml';
|
|
|
- DefaultVersionsFile = 'versions-%s.dat';
|
|
|
- DefaultMirrorsLocation = 'http://www.freepascal.org/repository/'+DefaultMirrorFile;
|
|
|
-{$warning TODO use real repository}
|
|
|
+ DefaultMirrorsURL = 'http://www.freepascal.org/repository/'+MirrorsFileName;
|
|
|
{$ifdef localrepository}
|
|
|
DefaultRemoteRepository = 'file://'+{$I %HOME%}+'/repository/';
|
|
|
{$else}
|
|
|
- DefaultRemoteRepository = 'http://www.freepascal.org/~peter/repository/';
|
|
|
+ DefaultRemoteRepository = 'auto';
|
|
|
{$endif}
|
|
|
|
|
|
// ini file keys
|
|
@@ -144,14 +136,12 @@ Const
|
|
|
KeyConfigVersion = 'ConfigVersion';
|
|
|
|
|
|
// Global config
|
|
|
- KeyLocalMirrorsLocation = 'LocalMirrors';
|
|
|
- KeyRemoteMirrorsLocation = 'RemoteMirrors';
|
|
|
+ KeyRemoteMirrorsURL = 'RemoteMirrors';
|
|
|
KeyRemoteRepository = 'RemoteRepository';
|
|
|
KeyLocalRepository = 'LocalRepository';
|
|
|
KeyPackagesDir = 'PackagesDir';
|
|
|
KeyBuildDir = 'BuildDir';
|
|
|
KeyCompilerConfigDir = 'CompilerConfigDir';
|
|
|
- KeyVerbosity = 'Verbosity';
|
|
|
KeyCompilerConfig = 'CompilerConfig';
|
|
|
KeyFPMakeCompilerConfig = 'FPMakeCompilerConfig';
|
|
|
KeyDownloader = 'Downloader';
|
|
@@ -178,14 +168,12 @@ end;
|
|
|
function TGlobalOptions.GetOptString(Index: integer): String;
|
|
|
begin
|
|
|
Case Index of
|
|
|
- 0 : Result:=FRemoteMirrorsLocation;
|
|
|
- 1 : Result:=FLocalMirrorsLocation;
|
|
|
+ 0 : Result:=FRemoteMirrorsURL;
|
|
|
2 : Result:=FRemoteRepository;
|
|
|
3 : Result:=FLocalRepository;
|
|
|
4 : Result:=FBuildDir;
|
|
|
5 : Result:=FPackagesDir;
|
|
|
6 : Result:=FCompilerConfigDir;
|
|
|
- 7 : Result:=FDefaultVerbosity;
|
|
|
8 : Result:=FDefaultCompilerConfig;
|
|
|
9 : Result:=FFPMakeCompilerConfig;
|
|
|
10 : Result:=FDownloader;
|
|
@@ -199,14 +187,12 @@ begin
|
|
|
If AValue=GetOptString(Index) then
|
|
|
Exit;
|
|
|
Case Index of
|
|
|
- 0 : FLocalMirrorsLocation:=AValue;
|
|
|
- 1 : FRemoteMirrorsLocation:=AValue;
|
|
|
+ 1 : FRemoteMirrorsURL:=AValue;
|
|
|
2 : FRemoteRepository:=AValue;
|
|
|
3 : FLocalRepository:=AValue;
|
|
|
4 : FBuildDir:=FixPath(AValue);
|
|
|
5 : FPackagesDir:=FixPath(AValue);
|
|
|
6 : FCompilerConfigDir:=FixPath(AValue);
|
|
|
- 7 : FDefaultVerbosity:=AValue;
|
|
|
8 : FDefaultCompilerConfig:=AValue;
|
|
|
9 : FFPMakeCompilerConfig:=AValue;
|
|
|
10 : FDownloader:=AValue;
|
|
@@ -217,21 +203,21 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-function TGlobalOptions.RemotePackagesFile:string;
|
|
|
+function TGlobalOptions.LocalPackagesFile:string;
|
|
|
begin
|
|
|
- Result:=FRemoteRepository+DefaultPackagesFile;
|
|
|
+ Result:=FLocalRepository+PackagesFileName;
|
|
|
end;
|
|
|
|
|
|
|
|
|
-function TGlobalOptions.LocalPackagesFile:string;
|
|
|
+function TGlobalOptions.LocalMirrorsFile:string;
|
|
|
begin
|
|
|
- Result:=FLocalRepository+DefaultPackagesFile;
|
|
|
+ Result:=FLocalRepository+MirrorsFileName;
|
|
|
end;
|
|
|
|
|
|
|
|
|
function TGlobalOptions.LocalVersionsFile(const ACompilerConfig:String):string;
|
|
|
begin
|
|
|
- Result:=FLocalRepository+Format(DefaultVersionsFile,[ACompilerConfig]);
|
|
|
+ Result:=FLocalRepository+Format(VersionsFileName,[ACompilerConfig]);
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -259,13 +245,11 @@ begin
|
|
|
FBuildDir:=LocalDir+'build'+PathDelim;
|
|
|
FPackagesDir:=LocalDir+'packages'+PathDelim;
|
|
|
FCompilerConfigDir:=LocalDir+'config'+PathDelim;
|
|
|
- FLocalMirrorsLocation:=LocalDir+DefaultMirrorFile;
|
|
|
FLocalRepository:=LocalDir;
|
|
|
// Remote
|
|
|
- FRemoteMirrorsLocation:=DefaultMirrorsLocation;
|
|
|
+ FRemoteMirrorsURL:=DefaultMirrorsURL;
|
|
|
FRemoteRepository:=DefaultRemoteRepository;
|
|
|
// Other config
|
|
|
- FDefaultVerbosity:='error,warning,info,debug,commands';
|
|
|
FDefaultCompilerConfig:='default';
|
|
|
FFPMakeCompilerConfig:='default';
|
|
|
// Downloader
|
|
@@ -280,55 +264,38 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-procedure TGlobalOptions.LoadGlobalFromIni(Ini: TCustomIniFile);
|
|
|
-begin
|
|
|
- With Ini do
|
|
|
- begin
|
|
|
- FConfigVersion:=ReadString(SDefaults,KeyConfigVersion,'');
|
|
|
- if FConfigVersion<>CurrentConfigVersion then
|
|
|
- Error('Old configuration found, please delete manual');
|
|
|
- FLocalMirrorsLocation:=ReadString(SDefaults,KeyLocalMirrorsLocation,FLocalMirrorsLocation);
|
|
|
- FRemoteMirrorsLocation:=ReadString(SDefaults,KeyRemoteMirrorsLocation,FRemoteMirrorsLocation);
|
|
|
- FRemoteRepository:=ReadString(SDefaults,KeyRemoteRepository,FRemoteRepository);
|
|
|
- FLocalRepository:=ReadString(SDefaults,KeyLocalRepository,FLocalRepository);
|
|
|
- FBuildDir:=FixPath(ReadString(SDefaults,KeyBuildDir,FBuildDir));
|
|
|
- FPackagesDir:=FixPath(ReadString(SDefaults,KeyPackagesDir,FPackagesDir));
|
|
|
- FCompilerConfigDir:=FixPath(ReadString(SDefaults,KeyCompilerConfigDir,FCompilerConfigDir));
|
|
|
- FDefaultVerbosity:=ReadString(SDefaults,KeyVerbosity,FDefaultVerbosity);
|
|
|
- FDefaultCompilerConfig:=ReadString(SDefaults,KeyCompilerConfig,FDefaultCompilerConfig);
|
|
|
- FFPMakeCompilerConfig:=ReadString(SDefaults,KeyFPMakeCompilerConfig,FFPMakeCompilerConfig);
|
|
|
- FDownloader:=ReadString(SDefaults,KeyDownloader,FDownloader);
|
|
|
- end;
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-procedure TGlobalOptions.SaveGlobalToIni(Ini: TCustomIniFile);
|
|
|
-begin
|
|
|
- With Ini do
|
|
|
- begin
|
|
|
- WriteString(SDefaults,KeyConfigVersion,FConfigVersion);
|
|
|
- WriteString(SDefaults,KeyBuildDir,FBuildDir);
|
|
|
- WriteString(SDefaults,KeyPackagesDir,FPackagesDir);
|
|
|
- WriteString(SDefaults,KeyCompilerConfigDir,FCompilerConfigDir);
|
|
|
- WriteString(SDefaults,KeyLocalRepository,FLocalRepository);
|
|
|
- WriteString(SDefaults,KeyLocalMirrorsLocation,FLocalMirrorsLocation);
|
|
|
- WriteString(SDefaults,KeyRemoteMirrorsLocation,FRemoteMirrorsLocation);
|
|
|
- WriteString(SDefaults,KeyRemoteRepository,FRemoteRepository);
|
|
|
- WriteString(SDefaults,KeyVerbosity,FDefaultVerbosity);
|
|
|
- WriteString(SDefaults,KeyCompilerConfig,FDefaultCompilerConfig);
|
|
|
- WriteString(SDefaults,KeyFPMakeCompilerConfig,FFPMakeCompilerConfig);
|
|
|
- WriteString(SDefaults,KeyDownloader,FDownloader);
|
|
|
- end;
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
procedure TGlobalOptions.LoadGlobalFromFile(const AFileName: String);
|
|
|
Var
|
|
|
Ini : TMemIniFile;
|
|
|
begin
|
|
|
- Ini:=TMemIniFile.Create(AFileName);
|
|
|
try
|
|
|
- LoadGlobalFromIni(Ini);
|
|
|
+ Ini:=TMemIniFile.Create(AFileName);
|
|
|
+ With Ini do
|
|
|
+ begin
|
|
|
+ FConfigVersion:=ReadInteger(SDefaults,KeyConfigVersion,0);
|
|
|
+ if (FConfigVersion<>CurrentConfigVersion) then
|
|
|
+ begin
|
|
|
+ Log(vlDebug,SLogUpgradingConfig,[AFileName]);
|
|
|
+ FDirty:=true;
|
|
|
+ if FConfigVersion<1 then
|
|
|
+ begin
|
|
|
+ FRemoteRepository:='auto';
|
|
|
+ end;
|
|
|
+ if (FConfigVersion>CurrentConfigVersion) then
|
|
|
+ Error(SErrUnsupportedConfigVersion,[AFileName]);
|
|
|
+ end;
|
|
|
+ FRemoteMirrorsURL:=ReadString(SDefaults,KeyRemoteMirrorsURL,FRemoteMirrorsURL);
|
|
|
+{$warning Temporary Config check, can be removed in March-2008}
|
|
|
+ if FConfigVersion>=1 then
|
|
|
+ FRemoteRepository:=ReadString(SDefaults,KeyRemoteRepository,FRemoteRepository);
|
|
|
+ FLocalRepository:=ReadString(SDefaults,KeyLocalRepository,FLocalRepository);
|
|
|
+ FBuildDir:=FixPath(ReadString(SDefaults,KeyBuildDir,FBuildDir));
|
|
|
+ FPackagesDir:=FixPath(ReadString(SDefaults,KeyPackagesDir,FPackagesDir));
|
|
|
+ FCompilerConfigDir:=FixPath(ReadString(SDefaults,KeyCompilerConfigDir,FCompilerConfigDir));
|
|
|
+ FDefaultCompilerConfig:=ReadString(SDefaults,KeyCompilerConfig,FDefaultCompilerConfig);
|
|
|
+ FFPMakeCompilerConfig:=ReadString(SDefaults,KeyFPMakeCompilerConfig,FFPMakeCompilerConfig);
|
|
|
+ FDownloader:=ReadString(SDefaults,KeyDownloader,FDownloader);
|
|
|
+ end;
|
|
|
finally
|
|
|
Ini.Free;
|
|
|
end;
|
|
@@ -341,9 +308,22 @@ Var
|
|
|
begin
|
|
|
if FileExists(AFileName) then
|
|
|
BackupFile(AFileName);
|
|
|
- Ini:=TIniFile.Create(AFileName);
|
|
|
try
|
|
|
- SaveGlobalToIni(Ini);
|
|
|
+ Ini:=TIniFile.Create(AFileName);
|
|
|
+ With Ini do
|
|
|
+ begin
|
|
|
+ WriteInteger(SDefaults,KeyConfigVersion,CurrentConfigVersion);
|
|
|
+ WriteString(SDefaults,KeyBuildDir,FBuildDir);
|
|
|
+ WriteString(SDefaults,KeyPackagesDir,FPackagesDir);
|
|
|
+ WriteString(SDefaults,KeyCompilerConfigDir,FCompilerConfigDir);
|
|
|
+ WriteString(SDefaults,KeyLocalRepository,FLocalRepository);
|
|
|
+ WriteString(SDefaults,KeyRemoteMirrorsURL,FRemoteMirrorsURL);
|
|
|
+ WriteString(SDefaults,KeyRemoteRepository,FRemoteRepository);
|
|
|
+ WriteString(SDefaults,KeyCompilerConfig,FDefaultCompilerConfig);
|
|
|
+ WriteString(SDefaults,KeyFPMakeCompilerConfig,FFPMakeCompilerConfig);
|
|
|
+ WriteString(SDefaults,KeyDownloader,FDownloader);
|
|
|
+ FDirty:=False;
|
|
|
+ end;
|
|
|
Ini.UpdateFile;
|
|
|
finally
|
|
|
Ini.Free;
|
|
@@ -443,7 +423,7 @@ begin
|
|
|
FCompilerVersion:=infosl[0];
|
|
|
FCompilerCPU:=StringToCPU(infosl[1]);
|
|
|
FCompilerOS:=StringToOS(infosl[2]);
|
|
|
- Log(vDebug,SLogDetectedCompiler,[FCompiler,FCompilerVersion,MakeTargetString(FCompilerCPU,FCompilerOS)]);
|
|
|
+ Log(vlDebug,SLogDetectedCompiler,[FCompiler,FCompilerVersion,MakeTargetString(FCompilerCPU,FCompilerOS)]);
|
|
|
// Use the same algorithm as the compiler, see options.pas
|
|
|
{$ifdef Unix}
|
|
|
FGlobalInstallDir:=FixPath(GetEnvironmentVariable('FPCDIR'));
|
|
@@ -465,45 +445,13 @@ begin
|
|
|
end;
|
|
|
FGlobalInstallDir:=ExpandFileName(FGlobalInstallDir);
|
|
|
{$endif unix}
|
|
|
- Log(vDebug,SLogDetectedFPCDIR,['global',FGlobalInstallDir]);
|
|
|
+ Log(vlDebug,SLogDetectedFPCDIR,['global',FGlobalInstallDir]);
|
|
|
// User writable install directory
|
|
|
if not IsSuperUser then
|
|
|
begin
|
|
|
FLocalInstallDir:=GlobalOptions.LocalRepository+'lib'+PathDelim+FCompilerVersion+PathDelim;
|
|
|
- Log(vDebug,SLogDetectedFPCDIR,['local',FLocalInstallDir]);
|
|
|
+ Log(vlDebug,SLogDetectedFPCDIR,['local',FLocalInstallDir]);
|
|
|
end;
|
|
|
- end;
|
|
|
-
|
|
|
-
|
|
|
-procedure TCompilerOptions.LoadCompilerFromIni(Ini: TCustomIniFile);
|
|
|
-begin
|
|
|
- With Ini do
|
|
|
- begin
|
|
|
- FConfigVersion:=ReadString(SDefaults,KeyConfigVersion,'');
|
|
|
- if FConfigVersion<>CurrentConfigVersion then
|
|
|
- Error('Old configuration found, please delete manual');
|
|
|
- FGlobalInstallDir:=FixPath(ReadString(SDefaults,KeyGlobalInstallDir,FGlobalInstallDir));
|
|
|
- FLocalInstallDir:=FixPath(ReadString(SDefaults,KeyLocalInstallDir,FLocalInstallDir));
|
|
|
- FCompiler:=ReadString(SDefaults,KeyCompiler,FCompiler);
|
|
|
- FCompilerOS:=StringToOS(ReadString(SDefaults,KeyCompilerOS,OSToString(CompilerOS)));
|
|
|
- FCompilerCPU:=StringToCPU(ReadString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU)));
|
|
|
- FCompilerVersion:=ReadString(SDefaults,KeyCompilerVersion,FCompilerVersion);
|
|
|
- end;
|
|
|
-end;
|
|
|
-
|
|
|
-
|
|
|
-procedure TCompilerOptions.SaveCompilerToIni(Ini: TCustomIniFile);
|
|
|
-begin
|
|
|
- With Ini do
|
|
|
- begin
|
|
|
- WriteString(SDefaults,KeyConfigVersion,FConfigVersion);
|
|
|
- WriteString(SDefaults,KeyGlobalInstallDir,FGlobalInstallDir);
|
|
|
- WriteString(SDefaults,KeyLocalInstallDir,FLocalInstallDir);
|
|
|
- WriteString(SDefaults,KeyCompiler,FCompiler);
|
|
|
- WriteString(SDefaults,KeyCompilerOS,OSToString(CompilerOS));
|
|
|
- WriteString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU));
|
|
|
- WriteString(SDefaults,KeyCompilerVersion,FCompilerVersion);
|
|
|
- end;
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -511,9 +459,25 @@ procedure TCompilerOptions.LoadCompilerFromFile(const AFileName: String);
|
|
|
Var
|
|
|
Ini : TMemIniFile;
|
|
|
begin
|
|
|
- Ini:=TMemIniFile.Create(AFileName);
|
|
|
try
|
|
|
- LoadCompilerFromIni(Ini);
|
|
|
+ Ini:=TMemIniFile.Create(AFileName);
|
|
|
+ With Ini do
|
|
|
+ begin
|
|
|
+ FConfigVersion:=ReadInteger(SDefaults,KeyConfigVersion,0);
|
|
|
+ if (FConfigVersion<>CurrentConfigVersion) then
|
|
|
+ begin
|
|
|
+ Log(vlDebug,SLogUpgradingConfig,[AFileName]);
|
|
|
+ FDirty:=true;
|
|
|
+ if (FConfigVersion>CurrentConfigVersion) then
|
|
|
+ Error(SErrUnsupportedConfigVersion,[AFileName]);
|
|
|
+ end;
|
|
|
+ FGlobalInstallDir:=FixPath(ReadString(SDefaults,KeyGlobalInstallDir,FGlobalInstallDir));
|
|
|
+ FLocalInstallDir:=FixPath(ReadString(SDefaults,KeyLocalInstallDir,FLocalInstallDir));
|
|
|
+ FCompiler:=ReadString(SDefaults,KeyCompiler,FCompiler);
|
|
|
+ FCompilerOS:=StringToOS(ReadString(SDefaults,KeyCompilerOS,OSToString(CompilerOS)));
|
|
|
+ FCompilerCPU:=StringToCPU(ReadString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU)));
|
|
|
+ FCompilerVersion:=ReadString(SDefaults,KeyCompilerVersion,FCompilerVersion);
|
|
|
+ end;
|
|
|
finally
|
|
|
Ini.Free;
|
|
|
end;
|
|
@@ -526,9 +490,19 @@ Var
|
|
|
begin
|
|
|
if FileExists(AFileName) then
|
|
|
BackupFile(AFileName);
|
|
|
- Ini:=TIniFile.Create(AFileName);
|
|
|
try
|
|
|
- SaveCompilerToIni(Ini);
|
|
|
+ Ini:=TIniFile.Create(AFileName);
|
|
|
+ With Ini do
|
|
|
+ begin
|
|
|
+ WriteInteger(SDefaults,KeyConfigVersion,CurrentConfigVersion);
|
|
|
+ WriteString(SDefaults,KeyGlobalInstallDir,FGlobalInstallDir);
|
|
|
+ WriteString(SDefaults,KeyLocalInstallDir,FLocalInstallDir);
|
|
|
+ WriteString(SDefaults,KeyCompiler,FCompiler);
|
|
|
+ WriteString(SDefaults,KeyCompilerOS,OSToString(CompilerOS));
|
|
|
+ WriteString(SDefaults,KeyCompilerCPU,CPUtoString(CompilerCPU));
|
|
|
+ WriteString(SDefaults,KeyCompilerVersion,FCompilerVersion);
|
|
|
+ FDirty:=False;
|
|
|
+ end;
|
|
|
Ini.UpdateFile;
|
|
|
finally
|
|
|
Ini.Free;
|