mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 21:23:03 +01:00
o Improve detection of previously installed products.
o Don't call instreg if an existing version of firebird is already installed. o Distinguish 2.1 as a major version that is distinct from 2.0. (ie, don't do a silent inplace upgrade - default to a new directory. User can still choose to install to an existing directory.) o Vista - Allow installer to start firebird service when installation is complete.
This commit is contained in:
parent
e18423c2c2
commit
c64ed709cd
@ -84,38 +84,44 @@ Const
|
||||
BrokenInstall = 32; //version or component mismatch found, so mark broken
|
||||
|
||||
//Possible product installs
|
||||
IB4Install = 0;
|
||||
IB5Install = 1;
|
||||
IB6Install = 2;
|
||||
IB65Install = 3;
|
||||
IB70Install = 4;
|
||||
FB1Install = 5;
|
||||
FB15RCInstall = 6;
|
||||
FB15Install = 7;
|
||||
FB20Install = 8;
|
||||
IB80Install = 9;
|
||||
IB81Install = 10;
|
||||
FB21Install = 11;
|
||||
FB25Install = 12;
|
||||
FB30Install = 13;
|
||||
IB4Install = 0;
|
||||
IB5Install = 1;
|
||||
IB6Install = 2;
|
||||
IB65Install = 3;
|
||||
IB70Install = 4;
|
||||
FB1Install = 5;
|
||||
FB15RCInstall = 6;
|
||||
FB15Install = 7;
|
||||
FB20Install = 8;
|
||||
IB80Install = 9;
|
||||
IB81Install = 10;
|
||||
FB21Install = 11;
|
||||
FB21_x64_Install = 12;
|
||||
FB25Install = 13;
|
||||
FB25_x64_Install = 14;
|
||||
FB30Install = 15;
|
||||
FB30_x64_Install = 16;
|
||||
|
||||
MaxProdInstalled = FB30Install;
|
||||
|
||||
//ProductsInstalled
|
||||
IB4 = $0001;
|
||||
IB5 = $0002;
|
||||
IB6 = $0004;
|
||||
IB65 = $0008;
|
||||
IB70 = $0010;
|
||||
FB1 = $0020;
|
||||
FB15RC = $0040;
|
||||
FB15 = $0080;
|
||||
FB20 = $0100;
|
||||
IB80 = $0200;
|
||||
IB81 = $0400;
|
||||
FB21 = $0800;
|
||||
FB25 = $1000;
|
||||
FB30 = $2000;
|
||||
MaxProdInstalled = FB30_x64_Install;
|
||||
|
||||
//ProductsInstalled
|
||||
IB4 = $00001;
|
||||
IB5 = $00002;
|
||||
IB6 = $00004;
|
||||
IB65 = $00008;
|
||||
IB70 = $00010;
|
||||
FB1 = $00020;
|
||||
FB15RC = $00040;
|
||||
FB15 = $00080;
|
||||
FB20 = $00100;
|
||||
IB80 = $00200;
|
||||
IB81 = $00400;
|
||||
FB21 = $00800;
|
||||
FB25 = $01000;
|
||||
FB30 = $02000;
|
||||
FB21_x64 = $04000;
|
||||
FB25_x64 = $08000;
|
||||
FB30_x64 = $10000;
|
||||
|
||||
// Likely gds32 version strings for installed versions of Firebird or InterBase are:
|
||||
// [6,0,n,n] InterBase 6.0
|
||||
@ -152,6 +158,7 @@ Type
|
||||
InstallType: Integer;
|
||||
ActualVersion: String;
|
||||
FirebirdVersion:String;
|
||||
RootKey: Integer;
|
||||
end;
|
||||
|
||||
|
||||
@ -162,6 +169,7 @@ procedure InitExistingInstallRecords;
|
||||
var
|
||||
product: Integer;
|
||||
begin
|
||||
|
||||
SetArrayLength(ProductsInstalledArray,MaxProdInstalled + 1);
|
||||
for product := 0 to MaxProdInstalled do begin
|
||||
|
||||
@ -174,6 +182,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IBRegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IB4MessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
IB5Install: begin
|
||||
@ -181,6 +190,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IB5RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
IB6Install: begin
|
||||
@ -188,6 +198,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IBRegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
IB65Install: begin
|
||||
@ -195,6 +206,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IBRegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
IB70Install: begin
|
||||
@ -202,6 +214,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IBRegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
IB80Install: begin
|
||||
@ -209,6 +222,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IBRegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
IB81Install: begin
|
||||
@ -216,6 +230,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IBRegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB1Install: begin
|
||||
@ -223,6 +238,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := IBRegKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := IBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB15RCInstall: begin
|
||||
@ -230,6 +246,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := FB15RCKey;
|
||||
ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB15Install: begin
|
||||
@ -237,6 +254,7 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB20Install: begin
|
||||
@ -244,36 +262,66 @@ begin
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB21Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc;
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB21_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB25Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc;
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB25_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
end;
|
||||
|
||||
FB30Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc;
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
end;
|
||||
|
||||
FB30_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
end;
|
||||
|
||||
end; //case
|
||||
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
|
||||
ProductsInstalledArray[product].RegVersion := GetRegistryEntry(
|
||||
ProductsInstalledArray[product].RegKey, 'Version');
|
||||
ProductsInstalledArray[product].RootKey, ProductsInstalledArray[product].RegKey, 'Version');
|
||||
|
||||
end; //for
|
||||
end; //function
|
||||
@ -533,6 +581,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
FB21_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '2.1.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB21_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end
|
||||
else
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB25Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '2.5.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
@ -543,6 +605,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
FB25_x64_Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '2.5.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB25_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB30Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '3.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
@ -553,6 +625,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
FB30_x64_Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '3.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB30_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;//case
|
||||
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
Function Prototypes
|
||||
|
||||
function IsWin32: boolean;
|
||||
function Is32BitInstallMode: boolean;
|
||||
function IsVista: boolean;
|
||||
function IsWin2k3: boolean;
|
||||
function IsWinXP: boolean;
|
||||
@ -108,6 +110,19 @@ v4.0 4.0.6001.16531 or greater Released with Windows Vista SP1 and
|
||||
systems do not have v3.0 of the Windows Installer.
|
||||
*)
|
||||
|
||||
|
||||
function IsWin32: boolean;
|
||||
//helper function to simplify logic of x86/win64 checks.
|
||||
begin
|
||||
result := not IsWin64;
|
||||
end;
|
||||
|
||||
function Is32BitInstallMode: boolean;
|
||||
//helper function to simplify logic of x86/win64 checks.
|
||||
begin
|
||||
result := not Is64BitInstallMode;
|
||||
end;
|
||||
|
||||
function IsVista: boolean;
|
||||
var
|
||||
Version: TWindowsVersion;
|
||||
@ -368,10 +383,17 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
function GetRegistryEntry(RegKey, RegEntry: string): String;
|
||||
|
||||
function GetRegistryEntry(RootKey: Integer; RegKey, RegEntry: string): String;
|
||||
begin
|
||||
result := '';
|
||||
RegQueryStringValue(HKEY_LOCAL_MACHINE, RegKey, RegEntry, Result);
|
||||
Result := '';
|
||||
//if not win64 and RootKey is HKLM64 then we are on a 32-bit box,
|
||||
//so skip looking in registry
|
||||
if ( (RootKey = HKLM64) AND (iswin32) ) then
|
||||
//do nothing
|
||||
Result := ''
|
||||
else
|
||||
RegQueryStringValue(RootKey, RegKey, RegEntry, Result);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -675,8 +675,12 @@ end;
|
||||
for i:=0 to ProductsInstalledCount-1 do
|
||||
InstallSummary := InstallSummary + InstallSummaryArray[i] + #13;
|
||||
|
||||
//If FB2 is installed
|
||||
If ((ProductsInstalled AND FB2) = FB2) then
|
||||
//If FB21 is installed
|
||||
#if PlatformTarget == "x64"
|
||||
If ((ProductsInstalled AND FB21_x64 ) = FB21_x64 ) then
|
||||
#else
|
||||
If ((ProductsInstalled AND FB21 ) = FB21 ) then
|
||||
#endif
|
||||
InstallSummary := InstallSummary
|
||||
+#13 + ExpandConstant('{cm:InstallSummarySuffix1}')
|
||||
+#13 + ExpandConstant('{cm:InstallSummarySuffix2}')
|
||||
@ -716,10 +720,14 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
//If Fb2.0 is installed then we can install over it.
|
||||
//unless we find the server running.
|
||||
if (ProductsInstalledCount = 1) AND
|
||||
((ProductsInstalled AND FB2) = FB2) then begin
|
||||
//If existing install of the same majorver.minorver is found then
|
||||
//we can upgrade it unless we find the server running.
|
||||
if ( (ProductsInstalledCount = 1) AND
|
||||
#if PlatformTarget == "x64"
|
||||
((ProductsInstalled AND FB21_x64 ) = FB21_x64 ) ) then begin
|
||||
#else
|
||||
((ProductsInstalled AND FB21 ) = FB21 ) ) then begin
|
||||
#endif
|
||||
VerString := ( FirebirdDefaultServerRunning );
|
||||
if VerString <> '' then begin
|
||||
result := false;
|
||||
|
Loading…
Reference in New Issue
Block a user