mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 22:43:03 +01:00
Improve installed product detection.
This commit is contained in:
parent
7f58f9a98f
commit
1efcf06858
@ -106,31 +106,55 @@ Const
|
||||
FB25_x64_Install = 14;
|
||||
FB30Install = 15;
|
||||
FB30_x64_Install = 16;
|
||||
Current32Install = FB30Install;
|
||||
Current64Install = FB30_x64_Install;
|
||||
FB40Install = 17;
|
||||
FB40_x64_Install = 18;
|
||||
FB50Install = 19;
|
||||
FB50_x64_Install = 20;
|
||||
FB60Install = 21;
|
||||
FB60_x64_Install = 22;
|
||||
FB70Install = 23;
|
||||
FB70_x64_Install = 24;
|
||||
FB80Install = 25;
|
||||
FB80_x64_Install = 26;
|
||||
FB90Install = 27;
|
||||
FB90_x64_Install = 28;
|
||||
Current32Install = FB40Install;
|
||||
Current64Install = FB40_x64_Install;
|
||||
|
||||
MaxProdInstalled = FB30_x64_Install;
|
||||
MaxProdInstalled = FB90_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;
|
||||
CurFB32 = FB30;
|
||||
CurFB64 = FB30_x64;
|
||||
IB4 = 0;
|
||||
IB5 = 1;
|
||||
IB6 = 2;
|
||||
IB65 = 3;
|
||||
IB70 = 4;
|
||||
FB1 = 5;
|
||||
FB15RC = 6;
|
||||
FB15 = 7;
|
||||
FB20 = 8;
|
||||
IB80 = 9;
|
||||
IB81 = 10;
|
||||
FB21 = 11;
|
||||
FB21_x64 = 12;
|
||||
FB25 = 13;
|
||||
FB25_x64 = 14;
|
||||
FB30 = 15;
|
||||
FB30_x64 = 16;
|
||||
FB40 = 17;
|
||||
FB40_x64 = 18;
|
||||
FB50 = 19;
|
||||
FB50_x64 = 20;
|
||||
FB60 = 21;
|
||||
FB60_x64 = 22;
|
||||
FB70 = 23;
|
||||
FB70_x64 = 24;
|
||||
FB80 = 25;
|
||||
FB80_x64 = 26;
|
||||
FB90 = 27;
|
||||
FB90_x64 = 28;
|
||||
CurFB32 = FB40;
|
||||
CurFB64 = FB40_x64;
|
||||
|
||||
// Likely gds32 version strings for installed versions of Firebird or InterBase are:
|
||||
// [6,0,n,n] InterBase 6.0
|
||||
@ -373,6 +397,138 @@ begin
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB40Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB40_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB50Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB50_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB60Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB60_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB70Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB70_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB80Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB80_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB90Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (Win32) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM32;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
FB90_x64_Install: begin
|
||||
ProductsInstalledArray[product].Description := FBDesc + ' (x64) ';
|
||||
ProductsInstalledArray[product].RegKey := FB2RegKey;
|
||||
ProductsInstalledArray[product].RegEntry := FBRegPathEntry;
|
||||
ProductsInstalledArray[product].MessageFile := FBMessageFile;
|
||||
ProductsInstalledArray[product].RootKey := HKLM64;
|
||||
ProductsInstalledArray[product].Path := GetRegistryEntry(ProductsInstalledArray[product].RootKey,
|
||||
ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry);
|
||||
ProductsInstalledArray[product].BinPath := ProductsInstalledArray[product].Path;
|
||||
end;
|
||||
|
||||
end; //case
|
||||
|
||||
ProductsInstalledArray[product].RegVersion := GetRegistryEntry(
|
||||
@ -705,6 +861,150 @@ begin
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
|
||||
FB40Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '4.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB40_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '4.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end
|
||||
end
|
||||
else
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
|
||||
FB50Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '5.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB50_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '5.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end
|
||||
end
|
||||
else
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
|
||||
FB60Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '6.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB60_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '6.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end
|
||||
end
|
||||
else
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
|
||||
FB70Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '7.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB70_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '7.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end
|
||||
end
|
||||
else
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
|
||||
FB80Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '8.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB80_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '8.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end
|
||||
end
|
||||
else
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
|
||||
FB90Install: begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '9.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
FB90_x64_Install: begin
|
||||
if iswin64 then begin
|
||||
if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '9.0.0.0',2) <> 0) then
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled
|
||||
else
|
||||
if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin
|
||||
ProductsInstalled := ProductsInstalled + FB40_x64;
|
||||
ProductsInstalledCount := ProductsInstalledCount + 1;
|
||||
end
|
||||
end
|
||||
else
|
||||
ProductsInstalledArray[product].InstallType := NotInstalled;
|
||||
end;
|
||||
|
||||
end;//case
|
||||
|
||||
|
||||
@ -801,7 +1101,7 @@ SharedFileArray[34].Filename := ExpandConstant('{app}')+'fbtracemgr.exe';
|
||||
SharedFileArray[35].Filename := ExpandConstant('{app}')+'zlib1.dll';
|
||||
SharedFileArray[36].Filename := ExpandConstant('{app}')+'replication.conf';
|
||||
|
||||
// FIXME
|
||||
// FIXME
|
||||
// Add in WOW64 here.
|
||||
|
||||
end;
|
||||
@ -1151,12 +1451,12 @@ begin
|
||||
|
||||
//If existing install of the same majorver.minorver is
|
||||
//found then we can upgrade it.
|
||||
//// **** FIX ME **** Don't use hardcoded constants here. They get overlooked.
|
||||
//// **** FIX ME **** Don't use hardcoded constants here. They get overlooked.
|
||||
if ( (ProductsInstalledCount = 1) AND
|
||||
#if PlatformTarget == "x64"
|
||||
((ProductsInstalled AND FB30_x64 ) = FB30_x64 ) ) then begin
|
||||
((ProductsInstalled AND FB40_x64 ) = FB40_x64 ) ) then begin
|
||||
#else
|
||||
((ProductsInstalled AND FB30 ) = FB30 ) ) then begin
|
||||
((ProductsInstalled AND FB40 ) = FB40 ) ) then begin
|
||||
#endif
|
||||
result := true;
|
||||
exit;
|
||||
|
Loading…
Reference in New Issue
Block a user