8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:40:38 +01:00

Modify firebird.conf at install time according to choice of server architecture.

This commit is contained in:
paul_reeves 2012-06-14 09:31:24 +00:00
parent ac9d11020a
commit 851fa1c447
2 changed files with 37 additions and 11 deletions

View File

@ -339,8 +339,9 @@ begin
CommentSize := Length(CommentType);
ArraySize := GetArrayLength(Lines)-1;
// Search through all textlines for given text
for i := 0 to ArraySize do begin
// Search through all textlines in reverse order for given text
// this way we can be sure to only change the active entry
for i := ArraySize downto 0 do begin
// Overwrite textline when text searched for is part of it
if Pos(StringToFind,Lines[i]) > 0 then begin
// does this line start with a comment ?
@ -349,13 +350,16 @@ begin
// only replace if line does not start with a comment
if CompareText(Copy(TempStr,1,CommentSize),CommentType) <> 0 then begin
Lines[i] := NewLine;
FileChanged := true
FileChanged := true;
Break;
end
end
end
else begin
Lines[i] := NewLine;
FileChanged := true
end
FileChanged := true;
Break;
end;
// break after first match.
end
end;

View File

@ -960,8 +960,10 @@ begin
end;
procedure UpdateFirebirdConf;
// Update firebird conf. If user has deselected the guardian we should update
// firebird.conf accordingly. Otherwise we leave the file unchanged.
// Update firebird conf.
// If user has deselected the guardian we should update firebird.conf accordingly.
// We also test if user has asked for classic or super server
// Otherwise we leave the file unchanged.
var
fbconf: TArrayOfString;
i, position: Integer;
@ -972,8 +974,29 @@ begin
//we are doing a server install, so the easiest way is to see if a
//firebird.conf exists. If it doesn't then we don't care.
if FileExists(GetAppPath+'\firebird.conf') then begin
if NOT (IsComponentSelected('ServerComponent') and IsTaskSelected('UseSuperServerTask\UseGuardianTask')) then
ReplaceLine(GetAppPath+'\firebird.conf','GuardianOption','GuardianOption = 0','#');
if (IsComponentSelected('ServerComponent') ) then begin
if not IsTaskSelected('UseSuperServerTask\UseGuardianTask') then
ReplaceLine(GetAppPath+'\firebird.conf','GuardianOption','GuardianOption = 0','#');
// Firstly we need to count how many lines begin with SharedCache and SharedDatabase
// If 0 or 1 then proceed to modify else log error in some way.
if IsTaskSelected('UseClassicServerTask') OR IsTaskSelected('UseSuperClassicTask') then begin
// This will force server to classic, irrespective of whether the existing settings are the default or not.
ReplaceLine(GetAppPath+'\firebird.conf','SharedCache = ','SharedCache = false','');
ReplaceLine(GetAppPath+'\firebird.conf','SharedDatabase = ','SharedDatabase = true','');
end;
if IsTaskSelected('UseSuperServerTask') OR IsTaskSelected('UseSuperClassicTask') then begin
// This will not change the settings if they are already commented out. (ie defaults will apply.)
ReplaceLine(GetAppPath+'\firebird.conf','SharedCache = ','SharedCache = true','#');
ReplaceLine(GetAppPath+'\firebird.conf','SharedDatabase = ','SharedDatabase = false','#');
end;
end;
end;
end;
@ -1163,7 +1186,6 @@ begin
end;
end;