From 7c6f7db340c413a1b729a0d0b7942e8d6ce3211f Mon Sep 17 00:00:00 2001 From: Paul Reeves Date: Sun, 5 Nov 2023 12:43:52 +0100 Subject: [PATCH] More rigorous test for existing configures sec db This should fix #7826 --- .../arch-specific/win32/FirebirdInstall.iss | 7 ++++++- .../FirebirdInstallEnvironmentChecks.inc | 21 ++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/builds/install/arch-specific/win32/FirebirdInstall.iss b/builds/install/arch-specific/win32/FirebirdInstall.iss index c8a0ca1112..6bf84d7660 100644 --- a/builds/install/arch-specific/win32/FirebirdInstall.iss +++ b/builds/install/arch-specific/win32/FirebirdInstall.iss @@ -615,6 +615,8 @@ program Setup; // a) Form a module or have common functionality // b) Debugged. // This hopefully keeps the main script simpler to follow. +const + UNDEFINED = -1; Var InstallRootDir: String; @@ -630,6 +632,7 @@ Var // databases.conf, fbtrace.conf and the security database. SYSDBAPassword: String; // SYSDBA password + init_secdb: integer; // Is set to UNDEFINED by default in InitializeSetup #ifdef setuplogging // Not yet implemented - leave log in %TEMP% @@ -722,6 +725,7 @@ begin InitExistingInstallRecords; AnalyzeEnvironment; result := AnalysisAssessment; + init_secdb := UNDEFINED; end; @@ -1035,7 +1039,8 @@ begin IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\security4.fdb', false); IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\replication.conf', false); - InitSecurityDB; + if init_secdb = 1 then + InitSecurityDB; //Fix up conf file UpdateFirebirdConf; diff --git a/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc b/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc index 5b0396755e..8d0fe6f114 100644 --- a/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc +++ b/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc @@ -1200,13 +1200,20 @@ end; function ConfigureAuthentication: boolean; begin - if IsNotServerInstall then - Result := false - else - if FileExists(WizardDirValue + '\security4.fdb') then - Result := false - else - Result := true; + // if it is the first time we are called test for existence of the security db + if init_secdb = UNDEFINED then begin + if FileExists(WizardDirValue + '\security4.fdb') then + Result := false + else + Result := true + end + else + // else the result is the current setting of init_secdb + Result := Boolean(init_secdb); + + // Whatever the result, cast it to an integer and update init_secdb + init_secdb := Integer(Result); + end;