From 2d1b902d282b221460cfae89553e21d3d67e0748 Mon Sep 17 00:00:00 2001 From: paul_reeves Date: Thu, 17 Feb 2005 15:04:23 +0000 Subject: [PATCH] Add supporting files to build Win32 packages --- .../FirebirdInstallEnvironmentChecks.inc | 697 +++++++++++++++ .../win32/FirebirdInstallSupportFunctions.inc | 247 ++++++ .../win32/FirebirdInstall_15.iss | 539 ------------ .../win32/FirebirdInstall_20.iss | 820 ++++++++++++++++++ .../arch-specific/win32/custom_messages.inc | 69 ++ .../arch-specific/win32/i18n_readme.txt | 138 +++ .../win32/installation_scripted.txt | 163 ++++ .../install/arch-specific/win32/setenvvar.bat | 35 - 8 files changed, 2134 insertions(+), 574 deletions(-) create mode 100644 builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc create mode 100644 builds/install/arch-specific/win32/FirebirdInstallSupportFunctions.inc delete mode 100644 builds/install/arch-specific/win32/FirebirdInstall_15.iss create mode 100644 builds/install/arch-specific/win32/FirebirdInstall_20.iss create mode 100644 builds/install/arch-specific/win32/custom_messages.inc create mode 100644 builds/install/arch-specific/win32/i18n_readme.txt create mode 100644 builds/install/arch-specific/win32/installation_scripted.txt delete mode 100644 builds/install/arch-specific/win32/setenvvar.bat diff --git a/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc b/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc new file mode 100644 index 0000000000..e0cc9b355b --- /dev/null +++ b/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc @@ -0,0 +1,697 @@ +(* Initial Developer's Public License. + The contents of this file are subject to the Initial Developer's Public + License Version 1.0 (the "License"). You may not use this file except + in compliance with the License. You may obtain a copy of the License at + http://www.ibphoenix.com?a=ibphoenix&page=ibp_idpl + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the + License. + + The Original Code is copyright 2001-2003 Paul Reeves for IBPhoenix. + + The Initial Developer of the Original Code is Paul Reeves for IBPhoenix. + + All Rights Reserved. + + This file contains a whole bunch of functions that + check the registry and see what versions of firebird or interbase + are already installed. + + This stuff _is_ firebird/interbase specific and some of it is entirely dependant + upon parts of the InnoSetup install script. + + Here is a list of functions available in this script: + + function ClassicInstallChosen: Boolean; + + procedure SetupSharedFilesArray; + procedure GetSharedLibCountBeforeCopy; + procedure CheckSharedLibCountAtEnd; + + function GetFirebirdDir: string; + function GetInterBaseDir: string; + function TestForWorkingInstalls: boolean; + + function FirebirdOneRunning: boolean; + + function InstallCPLApplet: boolean; + function ShowInstallCPLAppletTask: boolean; + function CopyGds32: boolean; + function ShowCopyGds32Task: boolean; + function CopyFbClientLib: boolean; + function ShowCopyFbClientLibTask: boolean; + + + *) + + + + + +//Registry keys for Firebird and InterBase +Const + //All InterBase and Firebird 1.0.n except IB5.n + IBRegKey = 'SOFTWARE\Borland\InterBase\CurrentVersion'; + //IB5.n + IB5RegKey = 'SOFTWARE\InterBase Corp\InterBase\CurrentVersion'; + //Fb15 RC + FB15RCKey = 'SOFTWARE\FirebirdSQL\Firebird\CurrentVersion'; + FB15RCKeyRoot = 'SOFTWARE\FirebirdSQL'; + + //All IB, Fb 1.0 and Fb 1.5RC's use RootDirectory entry + LegacyRegPathEntry = 'RootDirectory'; + + //Firebird 1.5 and beyond + FB2RegKey = 'SOFTWARE\Firebird Project\Firebird Server\Instances'; + + FBRegPathEntry = 'DefaultInstance'; //Stores path to root + + IB4MessageFile = 'interbas.msg'; + IBMessageFile = 'interbase.msg'; //IB5, IB6, IB7 and Fb 1.0 + FBMessageFile = 'firebird.msg'; //Fb2 codebase + + IBDesc = 'InterBase %s '; + FBDesc = 'Firebird %s '; + + + +Const + //Install Types + NotInstalled = 0; + ClientInstall = 1; + AdminInstall = 2; + SuperServerInstall = 4; + ClassicServerInstall = 8; + BrokenInstall = 32; //version or component mismatch found, so mark broken + + //Possible product installs + IB4Install = 0; + IB5Install = 1; + IB6Install = 2; + IB65Install = 3; + IB7Install = 4; + FB1Install = 5; + FB15RCInstall = 6; + FB15Install = 7; + FB2Install = 8; //All Fb 1.6 and beyond + MaxProdInstalled = FB2Install; + + //ProductsInstalled + IB4 = $0001; + IB5 = $0002; + IB6 = $0004; + IB65 = $0008; + IB7 = $0010; + FB1 = $0020; + FB15RC = $0040; + FB15 = $0080; + FB2 = $0100; + +Const + Install = 1; + Configure = 2; + +Var + ProductsInstalled: Integer; + ProductsInstalledCount: Integer; + InstallAndConfigure: Integer; + +Type + TProduct = record + ProductID: Integer; + Description: String; + RegKey: String; + RegEntry: String; + RegVersion: String; + MessageFile: String; + Path: String; + ClientVersion: String; + GBAKVersion: String; + ServerVersion: String; + InstallType: Integer; + ActualVersion: String; + FirebirdVersion:String; + end; + + +Var + ProductsInstalledArray: Array of TProduct; + +procedure InitExistingInstallRecords; +var + product: Integer; +begin + SetArrayLength(ProductsInstalledArray,MaxProdInstalled + 1); + for product := 0 to MaxProdInstalled do begin + + ProductsInstalledArray[product].ProductID := product; + + case product of + + IB4Install: begin + ProductsInstalledArray[product].Description := IBDesc; + ProductsInstalledArray[product].RegKey := IBRegKey; + ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry; + ProductsInstalledArray[product].MessageFile := IB4MessageFile; + end; + + IB5Install: begin + ProductsInstalledArray[product].Description := IBDesc; + ProductsInstalledArray[product].RegKey := IB5RegKey; + ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry; + ProductsInstalledArray[product].MessageFile := IBMessageFile; + end; + + IB6Install: begin + ProductsInstalledArray[product].Description := IBDesc; + ProductsInstalledArray[product].RegKey := IBRegKey; + ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry; + ProductsInstalledArray[product].MessageFile := IBMessageFile; + end; + + IB65Install: begin + ProductsInstalledArray[product].Description := IBDesc; + ProductsInstalledArray[product].RegKey := IBRegKey; + ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry; + ProductsInstalledArray[product].MessageFile := IBMessageFile; + end; + + IB7Install: begin + ProductsInstalledArray[product].Description := IBDesc; + ProductsInstalledArray[product].RegKey := IBRegKey; + ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry; + ProductsInstalledArray[product].MessageFile := IBMessageFile; + end; + + FB1Install: begin + ProductsInstalledArray[product].Description := FBDesc; + ProductsInstalledArray[product].RegKey := IBRegKey; + ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry; + ProductsInstalledArray[product].MessageFile := IBMessageFile; + end; + + FB15RCInstall: begin + ProductsInstalledArray[product].Description := FBDesc; + ProductsInstalledArray[product].RegKey := FB15RCKey; + ProductsInstalledArray[product].RegEntry := LegacyRegPathEntry; + ProductsInstalledArray[product].MessageFile := FBMessageFile; + end; + + FB15Install: begin + ProductsInstalledArray[product].Description := FBDesc; + ProductsInstalledArray[product].RegKey := FB2RegKey; + ProductsInstalledArray[product].RegEntry := FBRegPathEntry; + ProductsInstalledArray[product].MessageFile := FBMessageFile; + end; + + FB2Install: begin + ProductsInstalledArray[product].Description := FBDesc; + ProductsInstalledArray[product].RegKey := FB2RegKey; + ProductsInstalledArray[product].RegEntry := FBRegPathEntry; + ProductsInstalledArray[product].MessageFile := FBMessageFile; + end; + + end; //case + end; //for +end; //function + + +function GetRegistryEntry(RegKey, RegEntry: string): String; +begin + result := ''; + RegQueryStringValue(HKEY_LOCAL_MACHINE, RegKey, RegEntry, Result); +end; + + +Procedure AnalyzeEnvironment; +var + product: Integer; + gds32VersionString: String; + VerInt: Array of Integer; + BoolOne, BoolTwo, BoolEval: Boolean; + EvalOne, EvalTwo: Integer; +begin + + ProductsInstalled := 0; + ProductsInstalledCount := 0; + + //Test for gds32 version in + if FileExists(GetSysPath+'\gds32.dll') then begin + gds32VersionString := GetInstalledVersion(GetSysPath+'\gds32.dll',VerInt); + end; + + for product := 0 to MaxProdInstalled -1 do begin + + ProductsInstalledArray[product].Path := GetRegistryEntry( + ProductsInstalledArray[product].RegKey, ProductsInstalledArray[product].RegEntry); + + ProductsInstalledArray[product].RegVersion := GetRegistryEntry( + ProductsInstalledArray[product].RegKey, 'Version'); + + + if FileExists(ProductsInstalledArray[product].Path + '\bin\fbclient.dll') then + ProductsInstalledArray[product].ClientVersion := GetInstalledVersion( + ProductsInstalledArray[product].Path + '\bin\fbclient.dll',VerInt) + else + ProductsInstalledArray[product].ClientVersion := gds32VersionString; + + If (ProductsInstalledArray[product].Path<>'') AND (ProductsInstalledArray[product].ClientVersion <> '') AND + (FileExists(ProductsInstalledArray[product].Path+'\'+ProductsInstalledArray[product].MessageFile)) then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + ClientInstall + else + //The minimum requirements for a working client don't exist, so ignore this product. + Continue; + + + if ((ProductsInstalledArray[product].InstallType AND ClientInstall) = ClientInstall) then begin + + GetVersionNumbersString( ProductsInstalledArray[product].Path+'\bin\gbak.exe', + ProductsInstalledArray[product].GBAKVersion); + If ProductsInstalledArray[product].GBAKVersion <> '' then begin + ProductsInstalledArray[product].ActualVersion:=ProductsInstalledArray[product].GBAKVersion; + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + AdminInstall; + end; + + if FileExists(ProductsInstalledArray[product].Path+'\bin\fb_inet_server.exe') then begin + GetVersionNumbersString( ProductsInstalledArray[product].Path+'\bin\fb_inet_server.exe', + ProductsInstalledArray[product].ServerVersion); + If ProductsInstalledArray[product].ServerVersion <> '' then begin + ProductsInstalledArray[product].ActualVersion:=ProductsInstalledArray[product].ServerVersion; + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + ClassicServerInstall; + end; + end; + + if FileExists(ProductsInstalledArray[product].Path+'\bin\fbserver.exe') then begin + GetVersionNumbersString( ProductsInstalledArray[product].Path+'\bin\fbserver.exe', + ProductsInstalledArray[product].ServerVersion); + If ProductsInstalledArray[product].ServerVersion <> '' then begin + ProductsInstalledArray[product].ActualVersion:=ProductsInstalledArray[product].ServerVersion; + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + SuperServerInstall; + end; + end; + + if FileExists(ProductsInstalledArray[product].Path+'\bin\ibserver.exe') then begin + GetVersionNumbersString( ProductsInstalledArray[product].Path+'\bin\ibserver.exe', + ProductsInstalledArray[product].ServerVersion); + If ProductsInstalledArray[product].ServerVersion <> '' then begin + ProductsInstalledArray[product].ActualVersion:=ProductsInstalledArray[product].ServerVersion; + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + SuperServerInstall; + end; + end; + + //Now, resolve version numbers. If the version number + // Likely values for installed versions of Firebird are: + // [6,0,n,n] InterBase 6.0 + // [6,2,0,nnn] Firebird 1.0.0 + // [6,2,2,nnn] Firebird 1.0.2 + // [6,2,3,nnn] Firebird 1.0.3 + // [6,5,n,n] InterBase 6.5 + // [6,3,0,nnnn] Firebird 1.5.0 + // [7,0,n,n] InterBase 7.0 + + case product of + IB4Install: begin + //If we get here we must have an install, because the message file is unique to 4.n + ProductsInstalled := ProductsInstalled + IB4; + ProductsInstalledCount := ProductsInstalledCount + 1; + //check to see if the client library matches the server version installed. + if CompareVersion(ProductsInstalledArray[product].ActualVersion, '4.0.0.0',1) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + + end; + + IB5Install: begin + //If we get here we must have an install, because the registry key is unique to 5.n + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + IB5; + ProductsInstalledCount := ProductsInstalledCount + 1; + end; + //check to see if the client library matches the server version installed. + if CompareVersion(ProductsInstalledArray[product].ActualVersion, '5.0.0.0',1) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + end; + + IB6Install: begin + //If we get here we have ambiguity with other versions of InterBase and Firebird + if ( pos('InterBase',ProductsInstalledArray[product].RegVersion) > 0 ) then begin + if CompareVersion(ProductsInstalledArray[product].ClientVersion, '6.0.0.0',2) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + IB6; + ProductsInstalledCount := ProductsInstalledCount + 1; + end; + end + else + ProductsInstalledArray[product].InstallType := NotInstalled; + end; + + IB65Install: begin + //If we get here we have ambiguity with other versions of InterBase and Firebird + if ( pos('InterBase',ProductsInstalledArray[product].RegVersion) > 0 ) then begin + if CompareVersion(ProductsInstalledArray[product].ClientVersion, '6.5.0.0',2) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + IB65; + ProductsInstalledCount := ProductsInstalledCount + 1; + end; + end + else + ProductsInstalledArray[product].InstallType := NotInstalled; + end; + + IB7Install: begin + //If we get here we have ambiguity with other versions of InterBase and Firebird + if ( pos('InterBase',ProductsInstalledArray[product].RegVersion) > 0 ) then begin + if CompareVersion(ProductsInstalledArray[product].ClientVersion, '7.0.0.0',1) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + IB7; + ProductsInstalledCount := ProductsInstalledCount + 1; + end; + end + else + ProductsInstalledArray[product].InstallType := NotInstalled; + end; + + FB1Install: begin + if ( pos('Firebird',ProductsInstalledArray[product].RegVersion) > 0 ) then begin + if CompareVersion(ProductsInstalledArray[product].ClientVersion, '6.2.0.0',2) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + FB1; + ProductsInstalledCount := ProductsInstalledCount + 1; + ProductsInstalledArray[product].ActualVersion := ConvertIBVerStrToFbVerStr(ProductsInstalledArray[product].ActualVersion); + end; + end + else + ProductsInstalledArray[product].InstallType := NotInstalled; + end; + + FB15RCInstall: begin + if CompareVersion(ProductsInstalledArray[product].ClientVersion, '1.5.0.0',2) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + FB15RC; + ProductsInstalledCount := ProductsInstalledCount + 1; + end; + end; + + FB15Install: begin + if CompareVersion(ProductsInstalledArray[product].ClientVersion, '1.5.0.0',2) <> 0 then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + FB15; + ProductsInstalledCount := ProductsInstalledCount + 1; + end; + + end; + + FB2Install: begin + //We don't know (yet) what we should be comparing against here, ClientVersion + //should be equal or greater than 1.6.0.0 + if (CompareVersion(ProductsInstalledArray[product].ClientVersion, '1.6.0.0',2) < 0) then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + ProductsInstalled := ProductsInstalled + FB2; + ProductsInstalledCount := ProductsInstalledCount + 1; + end; + end; + + end;//case + + + if ((ProductsInstalledArray[product].InstallType <> NotInstalled) AND + //Check that we haven't already flagged the install as broken. + ((ProductsInstalledArray[product].InstallType AND BrokenInstall)<>BrokenInstall)) then begin + + //Now test that the version strings match! + if (CompareStr(ProductsInstalledArray[product].ClientVersion, ProductsInstalledArray[product].GBAKVersion)<> 0) then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall + else + if (CompareStr(ProductsInstalledArray[product].ClientVersion, ProductsInstalledArray[product].ServerVersion )<> 0) then + ProductsInstalledArray[product].InstallType := ProductsInstalledArray[product].InstallType + BrokenInstall; + + end; + + + end; //if ((ProductsInstalledArray[product].InstallType AND ClientInstall)= ClientInstall) then begin + end; //for +end; + + +Var + InterBaseVer: Array of Integer; + FirebirdVer: Array of Integer; + + +function ClassicInstallChosen: Boolean; +var + SelectedComponents: String; +begin + result := false; + + SelectedComponents := WizardSelectedComponents(false); + if pos(lowercase('ClassicServerComponent'),SelectedComponents) >0 then + result := true; +end; + + + +/////======================================= + + + +Type + TSharedFileArrayRecord = record + Filename: String; + Count: Integer; + end; + +var + SharedFileArray: Array of TSharedFileArrayRecord; + + + +procedure SetupSharedFilesArray; +//All shared files go in this list. Use +// find /n "sharedfile" FirebirdInstall_15.iss +//to list them in the order they appear in the setup script +begin +SetArrayLength(SharedFileArray,24); + +SharedFileArray[0].Filename := ExpandConstant('{app}')+'\IPLicense.txt'; +SharedFileArray[1].Filename := ExpandConstant('{app}')+'\IDPLicense.txt'; +SharedFileArray[2].Filename := ExpandConstant('{app}')+'\firebird.msg'; +SharedFileArray[3].Filename := ExpandConstant('{app}')+'\bin\gbak.exe'; +SharedFileArray[4].Filename := ExpandConstant('{app}')+'\bin\gfix.exe'; +SharedFileArray[5].Filename := ExpandConstant('{app}')+'\bin\gsec.exe'; +SharedFileArray[6].Filename := ExpandConstant('{app}')+'\bin\gsplit.exe'; +SharedFileArray[7].Filename := ExpandConstant('{app}')+'\bin\gstat.exe'; +SharedFileArray[8].Filename := ExpandConstant('{app}')+'\bin\fbguard.exe'; +SharedFileArray[9].Filename := ExpandConstant('{app}')+'\bin\fb_lock_print.exe'; + +if ClassicInstallChosen then + SharedFileArray[10].Filename := ExpandConstant('{app}')+'\bin\fb_inet_server.exe' +else + SharedFileArray[10].Filename := ExpandConstant('{app}')+'\bin\fbserver.exe'; + +SharedFileArray[11].Filename := ExpandConstant('{app}')+'\bin\ib_util.dll'; +SharedFileArray[12].Filename := ExpandConstant('{app}')+'\bin\instclient.exe'; +SharedFileArray[13].Filename := ExpandConstant('{app}')+'\bin\instreg.exe'; +SharedFileArray[14].Filename := ExpandConstant('{app}')+'\bin\instsvc.exe'; + +SharedFileArray[15].Filename := ExpandConstant('{sys}')+'\gds32.dll'; +SharedFileArray[16].Filename := ExpandConstant('{sys}')+'\fbclient.dll'; + +SharedFileArray[17].Filename := ExpandConstant('{app}')+'\bin\fbclient.dll'; + +SharedFileArray[18].Filename := ExpandConstant('{app}')+'\bin\msvcrt.dll'; +SharedFileArray[19].Filename := ExpandConstant('{app}')+'\bin\msvcp{#msvc_version}0.dll'; + +SharedFileArray[20].Filename := ExpandConstant('{app}')+'\bin\fbintl.dll'; + +SharedFileArray[21].Filename := ExpandConstant('{app}')+'\UDF\ib_udf.dll'; +SharedFileArray[22].Filename := ExpandConstant('{app}')+'\UDF\fbudf.dll'; + + +if UsingWinNT then + SharedFileArray[23].Filename := ExpandConstant('{sys}')+'\Firebird2Control.cpl' +else + SharedFileArray[23].Filename := ExpandConstant('{sys}')+'\FIREBI~1.CPL'; + + + +end; + + + +procedure GetSharedLibCountBeforeCopy; +var + dw: Cardinal; + i: Integer; +begin + for i:= 0 to GetArrayLength(SharedFileArray)-1 do begin + if RegQueryDWordValue(HKEY_LOCAL_MACHINE, + 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs',SharedFileArray[i].filename, dw) then + SharedFileArray[i].Count := dw + else + SharedFileArray[i].Count := 0; + end; +end; + + +procedure CheckSharedLibCountAtEnd; +// If a shared file exists on disk (from a manual install perhaps?) then +// the Installer will set the SharedFile count to 2 even if no registry +// entry exists. Is it a bug, an anomaly or a WAD? +// Is it InnoSetup or the O/S? +// Anyway, let's work around it, otherwise the files will appear 'sticky' +// after an uninstall. + +var + dw: cardinal; + i: Integer; + +begin + for i:= 0 to GetArrayLength(SharedFileArray)-1 do begin + if RegQueryDWordValue(HKEY_LOCAL_MACHINE, + 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs',SharedFileArray[i].Filename, dw) then begin + if (( dw - SharedFileArray[i].Count ) > 1 ) then begin + dw := SharedFileArray[i].Count + 1 ; + RegWriteDWordValue(HKEY_LOCAL_MACHINE, + 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs',SharedFileArray[i].Filename, dw); + end; + end; + end; +end; + + +///=================================================== + +function GetFirebirdDir: string; +//Check if Firebird installed, get version info to global var and return root dir +var + FirebirdDir: String; +begin + FirebirdDir := ''; + FirebirdVer := [0,0,0,0]; + RegQueryStringValue(HKEY_LOCAL_MACHINE, + 'SOFTWARE\Firebird Project\Firebird Server\Instances','DefaultInstance', FirebirdDir); + //If nothing returned then check for the registry entry used during beta/RC phase + if (FirebirdDir='') then + RegQueryStringValue(HKEY_LOCAL_MACHINE, + 'SOFTWARE\FirebirdSQL\Firebird\CurrentVersion','RootDirectory', FirebirdDir); + if (FirebirdDir<>'') then + GetInstalledVersion(FirebirdDir+'\bin\gbak.exe', FirebirdVer); + + Result := FirebirdDir; +end; + + + +function GetInterBaseDir: string; +//Check if InterBase installed, get version info to global var and return root dir +var + InterBaseDir: String; +begin + InterBaseDir := ''; + InterBaseVer := [0,0,0,0]; + RegQueryStringValue(HKEY_LOCAL_MACHINE, + 'SOFTWARE\Borland\InterBase\CurrentVersion','RootDirectory', InterBaseDir); + if ( InterBaseDir <> '' ) then + GetInstalledVersion(InterBaseDir+'\bin\gbak.exe',InterBaseVer); + + Result := InterBaseDir; +end; + + +function ConfigureFirebird: boolean; +begin + result := (InstallAndConfigure AND Configure) = Configure; +end; + + +function FirebirdOneRunning: boolean; +var + i: Integer; +begin + result := false; + + //Look for a running copy of InterBase or Firebird 1.0. + i:=0; + i:=FindWindowByClassName('IB_Server') ; + if ( i<>0 ) then + result := true; +end; + + +function FirebirdOneFiveRunning: boolean; +var + Handle: Integer; +begin + result := False; + //Look for a running version of Firebird 1.5 or later + Handle:=FindWindowByClassName('FB_Disabled'); + if ( Handle=0 ) then + Handle:=FindWindowByClassName('FB_Server'); + if ( Handle=0 ) then + Handle:=FindWindowByClassName('FB_Guard'); + + if (Handle>0) then + result := True; +end; + + +function InstallCPLApplet: boolean; +begin + result := False; + if ( (ConfigureFirebird) AND (not NoCPL) ) then + result := (ShouldProcessEntry('SuperServerComponent', 'InstallCPLAppletTask') = srYes) ; +end; + + +function ShowInstallCPLAppletTask: boolean; +begin + //If NOCPL is on the command line then don't offer the task in UI mode. + result := ((not NoCPL) and ConfigureFirebird); +end; + + + +function CopyGds32: boolean; +begin + //Note that we invert the value of NOLEGACYCLIENT so we provide the + //correct answer to the question 'Do we copy GDS32 to ' which is + //the default behaviour. + result := False; + if ConfigureFirebird then begin + //If one of these is false then either the commandline switch was passed + //or the user unchecked the Copy client as GDS32 box + result := ( (not NoLegacyClient) AND (ShouldProcessEntry('ClientComponent', 'CopyFbClientAsGds32Task')= srYes) ); + end; +end; + + +function ShowCopyGds32Task: boolean; +begin + //If NOGDS32 is on the command line then don't offer the task in UI mode. + result := ((not NoLegacyClient) and ConfigureFirebird); +end; + + +function CopyFbClientLib: boolean; +begin +//Note that the default for this is the opposite to CopyGds32. + result := ( (CopyFbClient) OR (ShouldProcessEntry('ClientComponent', 'CopyFbClientToSysTask')= srYes) ); +end; + + +function ShowCopyFbClientLibTask: boolean; +//See note for ShowCopyGds32Task. +begin + result := False; + if ConfigureFirebird then + result := ((not CopyFbClient) and ConfigureFirebird); +end; + diff --git a/builds/install/arch-specific/win32/FirebirdInstallSupportFunctions.inc b/builds/install/arch-specific/win32/FirebirdInstallSupportFunctions.inc new file mode 100644 index 0000000000..2cf42b58ab --- /dev/null +++ b/builds/install/arch-specific/win32/FirebirdInstallSupportFunctions.inc @@ -0,0 +1,247 @@ +(* Initial Developer's Public License. + The contents of this file are subject to the Initial Developer's Public + License Version 1.0 (the "License"). You may not use this file except + in compliance with the License. You may obtain a copy of the License at + http://www.ibphoenix.com?a=ibphoenix&page=ibp_idpl + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the + License. + + The Original Code is copyright 2001-2003 Paul Reeves for IBPhoenix. + + The Initial Developer of the Original Code is Paul Reeves for IBPhoenix. + + All Rights Reserved. + + Helper functions for FB installer + + These are / ought to be fairly generic + It makes more sense if they are independant functions - ie, they don't + call other functions in the script and they don't need to know about the + install script itself. + + They can call functions in the pascal script library + +Function Prototypes + + function UsingWin2k: boolean; + function UsingWinXP: boolean; + function CheckWinsock2(): Boolean; + function GetAppPath: String; + function GetSysPath: String; + function ReplaceLine(Filename, StringToFind, NewLine,CommentType: string): boolean; + procedure DecodeVersion( VerStr: String; var VerInt: array of Integer ); + function CompareVersion( ver1, ver2: String ) : Integer; + function GetInstalledVersion(BinaryFile: String): Array of Integer; + function ConvertIBVerStrToFbVerStr( VerStr: String) : String; + + + *) + +(* +InnoSetup Help Extract on Windows version strings: +4.0.950 Windows 95 +4.0.1111 Windows 95 OSR 2 & OSR 2.1 +4.0.1212 Windows 95 OSR 2.5 +4.1.1998 Windows 98 +4.1.2222 Windows 98 Second Edition +4.9.3000 Windows Me +Windows NT versions: +4.0.1381 Windows NT 4.0 +5.0.2195 Windows 2000 +5.01.2600 Windows XP +5.2.3790 Windows 2003 Standard +*) + +function UsingWin2k: boolean; +//return true if using Win2k OR later +begin + Result := (InstallOnThisVersion('0,5.0', '0,0') = irInstall); +end; + + +function UsingWinXP: boolean; +// return true if using WinXP OR later. +// Currently not used in this script. +begin + Result := (InstallOnThisVersion('0,5.01', '0,0') = irInstall); +end; + + +const + sWinSock2 = 'ws2_32.dll'; + sNoWinsock2 = 'Please Install Winsock 2 Update before continuing'; + sMSWinsock2Update = 'http://www.microsoft.com/windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp'; + sWinsock2Web = 'Winsock 2 is not installed.'#13#13'Would you like to Visit the Winsock 2 Update Home Page?'; + +var + Winsock2Failure: Boolean; + +function CheckWinsock2(): Boolean; +begin + Result := True; + //Check if Winsock 2 is installed (win 95 only) + if (not UsingWinNt) and (not FileExists(AddBackslash(GetSystemDir) + sWinSock2)) then begin + Winsock2Failure := True; + Result := False; + end + else + Winsock2Failure := False; +end; + + +function GetAppPath: String; +begin + Result := ExpandConstant('{app}'); +// Result := '"' + Result +'"'; +end; + + +function GetSysPath: String; +begin + Result := ExpandConstant('{sys}'); +// Result := '"' + Result +'"'; +end; + + +(*Based on InnoSetup KB example at http://www13.brinkster.com/vincenzog/isxart.asp?idart=14)*) +function ReplaceLine(Filename, StringToFind, NewLine,CommentType: string): boolean; +var + i: Integer; + Lines: TArrayOfString; + CommentSize: Integer; + ArraySize: Integer; + FileChanged: Boolean; + TempStr: String; +begin + // Load textfile into string array + LoadStringsFromFile(Filename, Lines); + + FileChanged := false; + CommentSize := Length(CommentType); + ArraySize := GetArrayLength(Lines)-1; + + // Search through all textlines for given text + for i := 0 to ArraySize 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 ? + if CommentSize > 0 then begin + TempStr := TrimLeft(Lines[i]); + // 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 + end + end + else begin + Lines[i] := NewLine; + FileChanged := true + end + end + end; + + // Save string array to textfile (overwrite, no append!) + if FileChanged = true then + SaveStringsToFile(Filename, Lines, false); + + Result := FileChanged; +end; + + +procedure DecodeVersion( VerStr: String; var VerInt: array of Integer ); +var + i,p: Integer; s: string; +begin + VerInt := [0,0,0,0]; + i := 0; + while ( (Length(VerStr) > 0) and (i < 4) ) do begin + p := pos('.', VerStr); + if p > 0 then begin + if p = 1 then s:= '0' else s:= Copy( VerStr, 1, p - 1 ); + VerInt[i] := StrToInt(s); + i := i + 1; + VerStr := Copy( VerStr, p+1, Length(VerStr)); + end + else begin + VerInt[i] := StrToInt( VerStr ); + VerStr := ''; + end; + end; +end; + + +function CompareVersion( ver1, ver2: String; places: Integer ) : Integer; +// This function compares version strings to number of places +// ie, if we are only interested in comparing major.minor versions +// then places = 2 +// return -1 if ver1 < ver2 +// return 0 if ver1 = ver2 +// return 1 if ver1 > ver2 +// +var + verint1, verint2: array of Integer; + i: integer; +begin + + if places > 4 then + places :=4; + + SetArrayLength( verint1, 4 ); + DecodeVersion( ver1, verint1 ); + + SetArrayLength( verint2, 4 ); + DecodeVersion( ver2, verint2 ); + + Result := 0; i := 0; + while ( (Result = 0) and ( i < places ) ) do begin + if verint1[i] > verint2[i] then + Result := 1 + else + if verint1[i] < verint2[i] then + Result := -1 + else + Result := 0; + + i := i + 1; + end; + +end; + + +function GetInstalledVersion(BinaryFile: String; var VerInt: Array of Integer): String; +var + AString: String; +begin + if (BinaryFile<>'') then begin + GetVersionNumbersString( BinaryFile, Astring ); + DecodeVersion( AString, VerInt ); + end; + result := AString; +end; + + +function ConvertIBVerStrToFbVerStr( VerStr: String) : String; +var + VerInt: array of Integer; + i: Integer; +begin + DecodeVersion(VerStr, VerInt); + VerInt[0]:=1; + if VerInt[1]=2 then + VerInt[1] := 0 + else + if VerInt[1]=3 then + VerInt[1]:=5; + + Result := ''; + for i:=0 to 3 do begin + Result := Result+IntToStr(VerInt[i]); + if i<3 then + Result:=Result+'.' + end; + +end; + + diff --git a/builds/install/arch-specific/win32/FirebirdInstall_15.iss b/builds/install/arch-specific/win32/FirebirdInstall_15.iss deleted file mode 100644 index 4d91efb8cd..0000000000 --- a/builds/install/arch-specific/win32/FirebirdInstall_15.iss +++ /dev/null @@ -1,539 +0,0 @@ -; Initial Developer's Public License. -; The contents of this file are subject to the Initial Developer's Public -; License Version 1.0 (the "License"). You may not use this file except -; in compliance with the License. You may obtain a copy of the License at -; http://www.ibphoenix.com/idpl.html -; Software distributed under the License is distributed on an "AS IS" basis, -; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -; for the specific language governing rights and limitations under the -; License. -; -; The Original Code is copyright 2001-2003 Paul Reeves for IBPhoenix. -; -; The Initial Developer of the Original Code is Paul Reeves for IBPhoenix. -; -; All Rights Reserved. -; -; Contributor(s): -; Tilo Muetze, Theo ? and Michael Rimov for improved detection -; of an existing install directory. -; Simon Carter for the WinSock2 detection. - -; Usage Notes: -; -; This script has been designed to work with My InnoSetup Extensions 3.0.6.2 -; or later. It may work with earlier versions but this is neither guaranteed -; nor tested. My InnoSetup Extensions is available from -; http://www.wintax.nl/isx/ -; - -;Either classic_server_install or super_server_install -;Default to SuperServer if not defined -#define super_server_install -#define server_architecture "SuperServer" -#define msvc_version 6 -#define FirebirdURL "http://www.firebirdsql.org" -#define BaseVer "1_5" - -[Setup] -AppName=Firebird Database Server 1.5 ({#server_architecture}) -;The following is important - all ISS install packages should -;duplicate this for v1.5. See the InnoSetup help for details. -AppID=FBDBServer_{#BaseVer} -AppVerName=Firebird 1.5.0 {#server_architecture} -AppPublisher=Firebird Project -AppPublisherURL={#FirebirdURL} -AppSupportURL={#FirebirdURL} -AppUpdatesURL={#FirebirdURL} -DefaultDirName={code:InstallDir|{pf}\Firebird\Firebird_{#BaseVer}} -DefaultGroupName=Firebird_{#BaseVer} -AllowNoIcons=true -SourceDir=..\..\..\..\ -LicenseFile=builds\install\misc\IPLicense.txt -InfoBeforeFile=builds\install\arch-specific\win32\installation_readme.txt -InfoAfterFile=builds\install\arch-specific\win32\readme.txt -AlwaysShowComponentsList=true -WizardImageFile=builds\install\arch-specific\win32\firebird_install_logo1.bmp -PrivilegesRequired=admin -#ifdef classic_server_install -UninstallDisplayIcon={app}\bin\fb_inet_server.exe -#else -UninstallDisplayIcon={app}\bin\fbserver.exe -#endif -OutputDir=builds\win32\install_image -OutputBaseFilename=Firebird-1.5.0-Win32-{#server_architecture} -Compression=bzip - -[Types] -Name: ServerInstall; Description: Full installation of server and development tools. -Name: DeveloperInstall; Description: Installation of Client tools for Developers and database administrators. -Name: ClientInstall; Description: Minimum client install - no server, no tools. - -[Components] -Name: ServerComponent; Description: Server component; Types: ServerInstall -Name: DevAdminComponent; Description: Tools component; Types: ServerInstall DeveloperInstall -Name: ClientComponent; Description: Client component; Types: ServerInstall DeveloperInstall ClientInstall; Flags: fixed disablenouninstallwarning - -[Tasks] -;Server tasks -Name: UseGuardianTask; Description: "Use the &Guardian to control the server?"; Components: ServerComponent; MinVersion: 4.0,4.0 -Name: UseApplicationTask; Description: An &Application?; GroupDescription: "Run Firebird server as:"; Components: ServerComponent; MinVersion: 4,4; Flags: exclusive -Name: UseServiceTask; Description: A &Service?; GroupDescription: "Run Firebird server as:"; Components: ServerComponent; MinVersion: 0,4; Flags: exclusive -Name: AutoStartTask; Description: "Start &Firebird automatically everytime you boot up?"; Components: ServerComponent; MinVersion: 4,4; -;Developer Tasks -Name: MenuGroupTask; Description: Create a Menu &Group; Components: ServerComponent; MinVersion: 4,4; -;One for Ron -;Name: MenuGroupTask\desktopicon; Description: Create a &desktop icon; Components: ServerComponent; MinVersion: 4.0,4.0; - -[Run] -;Always register Firebird -Filename: "{app}\bin\instreg.exe"; Parameters: "install ""{app}"" "; StatusMsg: Updating the registry; MinVersion: 4.0,4.0; Components: ClientComponent; Flags: runminimized - -;If on NT/Win2k etc and 'Install and start service' requested -Filename: "{app}\bin\instsvc.exe"; Parameters: "install ""{app}"" {code:ServiceStartFlags|""""} "; StatusMsg: "Setting up the service"; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized; Tasks: UseServiceTask; -Filename: "{app}\bin\instsvc.exe"; Description: "Start Firebird Service now?"; Parameters: start; StatusMsg: Starting the server; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized postinstall; Tasks: UseServiceTask; Check: StartEngine; - -;If 'start as application' requested -#ifdef classic_server_install -Filename: "{code:StartApp|{app}\bin\fb_inet_server.exe}"; Description: "Start Firebird now?"; Parameters: "-a"; StatusMsg: Starting the server; MinVersion: 0,4.0; Components: ServerComponent; Flags: nowait postinstall; Tasks: UseApplicationTask; Check: StartEngine; -#else -Filename: "{code:StartApp|{app}\bin\fbserver.exe}"; Description: "Start Firebird now?"; Parameters: "-a"; StatusMsg: Starting the server; MinVersion: 0,4.0; Components: ServerComponent; Flags: nowait postinstall; Tasks: UseApplicationTask; Check: StartEngine; -#endif - -[Registry] -;If user has chosen to start as App they may well want to start automatically. That is handled by a function below. -;Unless we set a marker here the uninstall will leave some annoying debris. -Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: Firebird; ValueData: ""; Flags: uninsdeletevalue; Tasks: UseApplicationTask; - -;This doesn't seem to get cleared automatically by instreg on uninstall, so lets make sure of it -Root: HKLM; Subkey: SOFTWARE\FirebirdSQL; Flags: uninsdeletekeyifempty; Components: ClientComponent DevAdminComponent ServerComponent; - -[Icons] -#ifdef classic_server_install -Name: "{group}\Firebird Server"; Filename: {app}\bin\fb_inet_server.exe; Parameters: "-a"; Flags: runminimized; MinVersion: 4.0,4.0; Tasks: MenuGroupTask; Check: InstallServerIcon; IconIndex: 0; Comment: "Run Firebird classic server (without guardian)"; -#else -Name: "{group}\Firebird Server"; Filename: {app}\bin\fbserver.exe; Parameters: "-a"; Flags: runminimized; MinVersion: 4.0,4.0; Tasks: MenuGroupTask; Check: InstallServerIcon; IconIndex: 0; Comment: "Run Firebird Superserver (without guardian)"; -#endif -Name: "{group}\Firebird Guardian"; Filename: {app}\bin\fbguard.exe; Parameters: "-a"; Flags: runminimized; MinVersion: 4.0,4.0; Tasks: MenuGroupTask; Check: InstallGuardianIcon; IconIndex: 1; Comment: "Run Firebird server (with guardian)"; -Name: "{group}\Firebird 1.5 Release Notes"; Filename: {app}\doc\Firebird_v1_ReleaseNotes.pdf; MinVersion: 4.0,4.0; Tasks: MenuGroupTask; IconIndex: 1; Comment: "Firebird 1.0 release notes. (Requires Acrobat Reader.)"; -Name: "{group}\Firebird 1.5 Readme"; Filename: {app}\readme.txt; MinVersion: 4.0,4.0; Tasks: MenuGroupTask; -Name: "{group}\Uninstall Firebird"; Filename: {uninstallexe}; Comment: "Uninstall Firebird" - -[Files] -Source: builds\install\misc\IPLicense.txt; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion; -Source: builds\install\arch-specific\win32\readme.txt; DestDir: {app}; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\firebird.conf; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall onlyifdoesntexist; -Source: output\aliases.conf; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall onlyifdoesntexist; -Source: output\security.fdb; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall onlyifdoesntexist; -Source: output\security.fbk; DestDir: {app}; Components: ServerComponent; Flags: ignoreversion; -Source: output\firebird.log; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall skipifsourcedoesntexist external dontcopy; -Source: output\firebird.msg; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion; -Source: output\bin\gbak.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\bin\gbak.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\bin\gdef.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\bin\gfix.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\bin\gfix.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\bin\gpre.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\bin\gsec.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\bin\gsec.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: sharedfile ignoreversion; -Source: output\bin\gsplit.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: sharedfile ignoreversion; -Source: output\bin\gstat.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\bin\fbguard.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\bin\fb_lock_print.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -#ifdef classic_server_install -Source: output\bin\fb_inet_server.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -#else -Source: output\bin\fbserver.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -#endif -Source: output\bin\ib_util.dll; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\bin\instreg.exe; DestDir: {app}\bin; Components: ClientComponent; Flags: sharedfile ignoreversion; -Source: output\bin\instsvc.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\bin\isql.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\bin\qli.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\doc\*.*; DestDir: {app}\doc; Components: DevAdminComponent; Flags: skipifsourcedoesntexist ignoreversion; -Source: output\doc\sql.extensions\*.*; DestDir: {app}\doc\sql.extensions; Components: DevAdminComponent; Flags: skipifsourcedoesntexist ignoreversion; -Source: output\help\*.*; DestDir: {app}\help; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\include\*.*; DestDir: {app}\include; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\intl\fbintl.dll; DestDir: {app}\intl; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\lib\*.*; DestDir: {app}\lib; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\UDF\*.*; DestDir: {app}\UDF; Components: ServerComponent; Flags: sharedfile ignoreversion; -Source: output\examples\*.*; DestDir: {app}\examples; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\examples\api\*.*; DestDir: {app}\examples\api; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\examples\build_win32\*.*; DestDir: {app}\examples\build_win32; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\examples\dyn\*.*; DestDir: {app}\examples\dyn; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\examples\empbuild\*.*; DestDir: {app}\examples\empbuild; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\examples\include\*.*; DestDir: {app}\examples\include; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\examples\stat\*.*; DestDir: {app}\examples\stat; Components: DevAdminComponent; Flags: ignoreversion; -Source: output\examples\udf\*.*; DestDir: {app}\examples\udf; Components: DevAdminComponent; Flags: ignoreversion; -;For now (RC2 timeframe) we are not recommending co-existence with other versions of Firebird or InterBase -;so we can install the client library and its wrapper into {sys} -;Source: output\bin\gds32.dll; DestDir: {app}\bin; Components: ClientComponent; Flags: overwritereadonly sharedfile promptifolder; -;Source: output\bin\fbclient.dll; DestDir: {app}\bin; Components: ClientComponent; Flags: overwritereadonly sharedfile promptifolder; -Source: output\bin\gds32.dll; DestDir: {sys}\; Components: ClientComponent; Flags: overwritereadonly sharedfile promptifolder; -Source: output\bin\fbclient.dll; DestDir: {sys}\; Components: ClientComponent; Flags: overwritereadonly sharedfile promptifolder; -Source: builds\install\arch-specific\win32\msvcrt.dll; DestDir: {sys}\; Components: ClientComponent; Flags: uninsneveruninstall sharedfile onlyifdoesntexist; -Source: builds\install\arch-specific\win32\msvcp{#msvc_version}0.dll; DestDir: {sys}\; Components: ClientComponent; Flags: uninsneveruninstall sharedfile onlyifdoesntexist; -Source: src\extlib\fbudf\fbudf.sql; DestDir: {app}\examples; Components: ServerComponent; Flags: ignoreversion; -Source: src\extlib\fbudf\fbudf.txt; DestDir: {app}\doc; Components: ServerComponent; Flags: ignoreversion; -Source: lang_helpers\ib_util.pas; DestDir: {app}\include; Components: DevAdminComponent; Flags: ignoreversion; -;Source: firebird\install\doc_all_platforms\Firebird_v1_ReleaseNotes.pdf; DestDir: {app}\doc; Components: DevAdminComponent; Flags: ignoreversion; -;Source: firebird\install\doc_all_platforms\Firebird_v1_*.html; DestDir: {app}\doc; Components: DevAdminComponent; Flags: ignoreversion; - -[UninstallRun] -Filename: {app}\bin\instsvc.exe; Parameters: stop; StatusMsg: "Stopping the service"; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized; Tasks: UseServiceTask; check: RemoveThisVersion; -Filename: {app}\bin\instsvc.exe; Parameters: remove -g; StatusMsg: "Removing the service"; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized; Tasks: UseServiceTask; check: RemoveThisVersion; -Filename: {app}\bin\instreg.exe; Parameters: remove; StatusMsg: "Updating the registry"; MinVersion: 4.0,4.0; Flags: runminimized; check: RemoveThisVersion; - -[UninstallDelete] -Type: files; Name: {app}\*.lck -Type: files; Name: {app}\*.evn - -[_ISTool] -EnableISX=true - -[Code] -program Setup; - -const - sWinSock2 = 'ws2_32.dll'; - sNoWinsock2 = 'Please Install Winsock 2 Update before continuing'; - sMSWinsock2Update = 'http://www.microsoft.com/windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp'; - sWinsock2Web = 'Winsock 2 is not installed.'#13#13'Would you like to Visit the Winsock 2 Update Home Page?'; - ProductVersion = 'PRODUCT_VER_STRING'; - -var - Winsock2Failure: Boolean; - InterBaseVer: Array of Integer; - // Likely values for installed versions of InterBase are: - // [6,2,0,nnn] Firebird 1.0.0 - // [6,2,2,nnn] Firebird 1.0.2 - // [6,0,n,n] InterBase 6.0 - // [6,5,n,n] InterBase 6.5 - // [7,0,n,n] InterBase 7.0 - - FirebirdVer: Array of Integer; - // Likely values for installed versions of Firebird are: - // [6,2,0,nnn] Firebird 1.0.0 - // [6,2,2,nnn] Firebird 1.0.2 - // [6,2,3,nnn] Firebird 1.0.3 - // [1,5,0,nnnn] Firebird 1.5.0 - - fbclientStartCount, - gds32StartCount : Integer; - -procedure GetSharedLibCountAtStart; -var - dw: Cardinal; -begin - if RegQueryDWordValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs','C:\WINNT\System32\fbclient.dll', dw) then - fbclientStartCount := dw - else - fbclientStartCount := 0; - - if RegQueryDWordValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs','C:\WINNT\System32\gds32.dll', dw) then - gds32StartCount := dw - else - gds32StartCount := 0; - -end; - -procedure SetSharedLibCountAtEnd; -// gds32 and fbclient get registered twice as shared libraries. -// This appears to be a bug in InnoSetup. It only appears to affect -// libraries the first time they are registered, and it only seems -// to affect stuff in the {sys} directory. To work around this we -// check the count before install and after install. -var - dw: cardinal; -begin - if RegQueryDWordValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs','C:\WINNT\System32\fbclient.dll', dw) then begin - - if (( dw - fbclientStartCount ) > 1 ) then begin - dw := fbclientStartCount + 1 ; - RegWriteDWordValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs','C:\WINNT\System32\fbclient.dll', dw); - end; - end; - - if RegQueryDWordValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs','C:\WINNT\System32\gds32.dll', dw) then begin - - if (( dw - gds32StartCount ) > 1 ) then begin - dw := gds32StartCount + 1 ; - RegWriteDWordValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs','C:\WINNT\System32\gds32.dll', dw); - end; - end; -end; - -function CheckWinsock2(): Boolean; -begin - Result := True; - //Check if Winsock 2 is installed (win 95 only) - if (not UsingWinNt) and (not FileExists(AddBackslash(GetSystemDir) + sWinSock2)) then begin - Winsock2Failure := True; - Result := False; - end - else - Winsock2Failure := False; -end; - -function InitializeSetup(): Boolean; -var - i: Integer; -begin - - result := true; - - if not CheckWinsock2 then - exit; - - //Look for a running version of Firebird - i:=FindWindowByClassName('FB_Disabled'); - if ( i=0 ) then - i:=FindWindowByClassName('FB_Server'); - - if ( i<>0 ) then begin - result := false; - MsgBox('An existing Firebird Server is running. You must close the '+ - 'application or stop the service before continuing.', mbError, MB_OK); - end; - - //Check the shared library count. - if ( result=true ) then - GetSharedLibCountAtStart; - -end; - -procedure DeInitializeSetup(); -var - ErrCode: Integer; -begin - // Did the install fail because winsock 2 was not installed? - if Winsock2Failure then - // Ask user if they want to visit the Winsock2 update web page. - if MsgBox(sWinsock2Web, mbInformation, MB_YESNO) = idYes then - // User wants to visit the web page - InstShellExec(sMSWinsock2Update, '', '', SW_SHOWNORMAL, ErrCode); - -end; - -procedure DecodeVersion( verstr: String; var verint: array of Integer ); -var - i,p: Integer; s: string; -begin - verint := [0,0,0,0]; - i := 0; - while ( (Length(verstr) > 0) and (i < 4) ) do - begin - p := pos('.', verstr); - if p > 0 then - begin - if p = 1 then s:= '0' else s:= Copy( verstr, 1, p - 1 ); - verint[i] := StrToInt(s); - i := i + 1; - verstr := Copy( verstr, p+1, Length(verstr)); - end - else - begin - verint[i] := StrToInt( verstr ); - verstr := ''; - end; - end; -end; - -function GetInstalledVersion(ADir: String): Array of Integer; -var - AString: String; - VerInt: Array of Integer; -begin - if (ADir<>'') then begin - GetVersionNumbersString( ADir+'\bin\gbak.exe', Astring); - DecodeVersion(AString, VerInt); - end; - result := VerInt; -end; - -function GetFirebirdDir: string; -//Check if Firebird installed, get version info to global var and return root dir -var - FirebirdDir: String; -begin - FirebirdVer := [0,0,0,0]; - RegQueryStringValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\FirebirdSQL\Firebird\CurrentVersion','RootDirectory', FirebirdDir); - if (FirebirdDir<>'') then - FirebirdVer:=GetInstalledVersion(FirebirdDir); -end; - -function GetInterBaseDir: string; -//Check if InterBase installed, get version info to global var and return root dir -var - InterBaseDir: String; -begin - InterBaseVer := [0,0,0,0]; - RegQueryStringValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\Borland\InterBase\CurrentVersion','RootDirectory', InterBaseDir); - if (InterBaseDir<>'') then - InterBaseVer:=GetInstalledVersion(InterBaseDir); -end; - -//This function tries to find an existing install of Firebird 1.5 -//If it succeeds it suggests that directory for the install -//Otherwise it suggests the default for Fb 1.5 -function InstallDir(Default: String): String; -var - InstallRootDir, - InterBaseRootDir, - FirebirdRootDir: String; -begin - InstallRootDir := ''; - - // Try to find the value of "RootDirectory" in the Firebird - // registry settings. This is either where Fb 1.0 exists or Fb 1.5 - InterBaseRootDir:=GetInterBaseDir; - FirebirdRootDir:=GetFirebirdDir; - - if (FirebirdRootDir <> '') and ( FirebirdRootDir = InterBaseRootDir ) then //Fb 1.0 must be installed so don't overwrite it. - InstallRootDir := Default; - - if (( InstallRootDir = '' ) and - ( FirebirdRootDir = Default )) then // Fb 1.5 is already installed, - InstallRootDir := Default; // so we offer to install over it - - if (( InstallRootDir = '') and - ( FirebirdVer[0] = 1 ) and ( FirebirdVer[1] = 5 ) ) then // Firebird 1.5 is installed - InstallRootDir := FirebirdRootDir; // but the user has changed the default - - // if we haven't found anything then try the FIREBIRD env var - // User may have preferred location for Firebird, but has possibly - // uninstalled previous version - if (InstallRootDir = '') then - InstallRootDir:=getenv('FIREBIRD'); - - //if no existing locations found make sure we default to the default. - if (InstallRootDir = '') then - InstallRootDir := Default; - - Result := ExpandConstant(InstallRootDir); - -end; - -function UseGuardian(Default: String): String; -begin -if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srYes then - Result := '1' -else - Result := '0'; -end; - -function ServiceStartFlags(Default: String): String; -var - classic: String; -begin - classic := ''; -#ifdef classic_server_install - classic := ' -classic'; -#endif - Result := ''; - if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srYes then begin - if ShouldProcessEntry('ServerComponent', 'AutoStartTask')= srYes then - Result := ' -auto ' + classic + ' -g ' - else - Result := classic + ' -g '; - end - else - if ShouldProcessEntry('ServerComponent', 'AutoStartTask')= srYes then - Result := ' -auto '; -end; - -function InstallGuardianIcon(): Boolean; -begin - result := false; - if ShouldProcessEntry('ServerComponent', 'UseApplicationTask')= srYes then - if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srYes then - result := true; -end; - -function InstallServerIcon(): Boolean; -begin - result := false; - if ShouldProcessEntry('ServerComponent', 'UseApplicationTask')= srYes then - if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srNo then - result := true; -end; - -function StartApp(Default: String): String; -var - AppPath: String; -begin - AppPath:=ExpandConstant('{app}'); - //Now start the app as - if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srYes then - Result := AppPath+'\bin\fbguard.exe' - else -#ifdef classic_server_install - Result := AppPath+'\bin\fb_inet_server.exe'; -#else - Result := AppPath+'\bin\fbserver.exe'; -#endif -end; - -procedure CurStepChanged(CurStep: Integer); -var - AppStr: String; -begin - if ( CurStep=csFinished ) then begin - //If user has chosen to install an app and run it automatically set up the registry accordingly - //so that the server or guardian starts evertime they login. - if (ShouldProcessEntry('ServerComponent', 'AutoStartTask')= srYes) and - ( ShouldProcessEntry('ServerComponent', 'UseApplicationTask')= srYes ) then begin - AppStr := StartApp('')+' -a'; - - RegWriteStringValue (HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run', 'Firebird', AppStr); - - end; - end; - - if ( CurStep=csFinished ) then - //Check that the shared lib count is correct. - SetSharedLibCountAtEnd; - -end; - -function FirebirdOneRunning: boolean; -var - i: Integer; -begin - result := false; - - //Look for a running copy of InterBase or Firebird 1.0. - i:=0; - i:=FindWindowByClassName('IB_Server') ; - if ( i<>0 ) then - result := true; - -end; - -function StartEngine: boolean; -begin - result := not FirebirdOneRunning; -end; - -function RemoveThisVersion: boolean; -//check if we are still the current version before removing -var - VersionStr: string; -begin - result := false; - if RegQueryStringValue(HKEY_LOCAL_MACHINE, - 'SOFTWARE\FirebirdSQL\Firebird\CurrentVersion','Version', VersionStr ) then - if (pos(ProductVersion,VersionStr)>0) then - result := true; -end; - -begin -end. diff --git a/builds/install/arch-specific/win32/FirebirdInstall_20.iss b/builds/install/arch-specific/win32/FirebirdInstall_20.iss new file mode 100644 index 0000000000..85e856d69c --- /dev/null +++ b/builds/install/arch-specific/win32/FirebirdInstall_20.iss @@ -0,0 +1,820 @@ +; Initial Developer's Public License. +; The contents of this file are subject to the Initial Developer's Public +; License Version 1.0 (the "License"). You may not use this file except +; in compliance with the License. You may obtain a copy of the License at +; http://www.ibphoenix.com?a=ibphoenix&page=ibp_idpl +; Software distributed under the License is distributed on an "AS IS" basis, +; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +; for the specific language governing rights and limitations under the +; License. +; +; The Original Code is copyright 2001-2003 Paul Reeves for IBPhoenix. +; +; The Initial Developer of the Original Code is Paul Reeves for IBPhoenix. +; +; All Rights Reserved. +; +; Contributor(s): +; Tilo Muetze, Theo ? and Michael Rimov for improved detection +; of an existing install directory. +; Simon Carter for the WinSock2 detection. +; Philippe Makowski for internationalization and french translation + +; Usage Notes: +; +; This script has been designed to work with Inno Setup v4.2.7 +; with Inno Setup Preprocessor v. 1.2.1.295. It is available +; as a quick start pack from here: +; http://www.jrsoftware.org/isdl.php#qsp +; +; +; Known bugs and problems etc etc. +; +; o The uninstaller can only uninstall what it installed. +; For instance, if Firebird is installed as a service, but is actually +; running as an application when the uninstaller is run then the +; application will not be stopped and the uninstall will not complete +; cleanly. +; +; InnoSetup does not support script execution as part of uninstallation. +; And this feature is not likely to be added in the near future. Here is +; the definitive explanation from Jordan Russell, the developer of InnoSetup: +; +; 'The uninstaller currently relies on a 100% forward compatible uninstall +; log format. When an existing uninstall log is appended to, and the +; uninstaller EXE is replaced with a newer version, the previous log contents +; are guaranteed to be processed properly. There are no such guarantees of +; forward compatibility with the Pascal Scripting feature; some support +; functions might be removed at some point, their declarations might change, +; etc. For the uninstaller to support Pascal Scripting, it would likely have +; to abandon the uninstall-log-appending concept, and instead create multiple +; uninstaller EXEs (chained together somehow) and multiple uninstall logs.' +; +; To work around this we will probably need to extend the instsvc/instreg +; utilities to support uninstallation of applications. +; +; +; o The uninstaller does not know how to stop multiple instances of a classic +; server. They must be stopped manually. +; +; +; + +;-------Innosetup script debug flags +;A dynamically generated sed script sets the appropriate define +;See BuildExecutableInstall.bat for more details. + +;This define is not used in practice, but is retained for documentation +;purposes. If set to iss_release it implies that the defines for files, +;examples and compression are set. +#define iss_release + +#define files +#define examples +#define compression + +;-------end of Innosetup script debug flags section + + +;-------Start of Innosetup script +#define msvc_version 6 +#define FirebirdURL "http://www.firebirdsql.org" +#define BaseVer "2_0" +#define release +#define no_pdb +#define i18n + +;------Undefine specifically for this Alpha build +#undef i18n + +;Some strings to distinguish the name of final executable +#ifdef ship_pdb +#define pdb_str="_pdb" +#else +#define pdb_str="" +#endif +#ifdef debug +#define debug_str="_debug" +#else +#define debug_str="" +#endif + +#define package_number="0" + + +[Setup] +AppName={cm:MyAppName} +;The following is important - all ISS install packages should +;duplicate this. See the InnoSetup help for details. +AppID=FBDBServer_{#BaseVer} +AppVerName=Firebird 2.0.0 +AppPublisher=Firebird Project +AppPublisherURL={#FirebirdURL} +AppSupportURL={#FirebirdURL} +AppUpdatesURL={#FirebirdURL} +DefaultDirName={code:ChooseInstallDir|{pf}\Firebird\Firebird_{#BaseVer}} +DefaultGroupName=Firebird_{#BaseVer} +AllowNoIcons=true +SourceDir=..\..\..\..\ +LicenseFile=builds\install\misc\IPLicense.txt +AlwaysShowComponentsList=true +WizardImageFile=builds\install\arch-specific\win32\firebird_install_logo1.bmp +PrivilegesRequired=admin +UninstallDisplayIcon={code:ChooseUninstallIcon|{app}\bin\fbserver.exe} +OutputDir=builds\install_images +OutputBaseFilename=Firebird-2.0.0-{#package_number}-Win32{#debug_str}{#pdb_str} +#ifdef compression +Compression=lzma +SolidCompression=true +#else +Compression=none +SolidCompression=false +#endif + +ShowTasksTreeLines=false +LanguageDetectionMethod=uilanguage + +[Languages] +Name: en; MessagesFile: compiler:Default.isl; InfoBeforeFile: builds\install\arch-specific\win32\installation_readme.txt; InfoAfterFile: builds\install\arch-specific\win32\readme.txt; +#ifdef i18n +Name: fr; MessagesFile: compiler:Languages\French.isl; InfoBeforeFile: builds\install\arch-specific\win32\fr\installation_lisezmoi.txt; InfoAfterFile: builds\install\arch-specific\win32\fr\lisezmoi.txt; +Name: de; MessagesFile: compiler:Languages\German.isl; InfoBeforeFile: builds\install\arch-specific\win32\de\installation_liesmich.txt; InfoAfterFile: builds\install\arch-specific\win32\de\liesmich.txt +Name: hu; MessagesFile: compiler:Languages\Hungarian.isl; InfoBeforeFile: builds\install\arch-specific\win32\installation_readme.txt; InfoAfterFile: builds\install\arch-specific\win32\readme.txt; +Name: pt; MessagesFile: compiler:Languages\PortugueseStd.isl; InfoBeforeFile: builds\install\arch-specific\win32\pt\instalação_leia-me.txt; InfoAfterFile: builds\install\arch-specific\win32\pt\leia-me.txt +Name: si; MessagesFile: compiler:Languages\Slovenian.isl; InfoBeforeFile: builds\install\arch-specific\win32\si\instalacija_precitajMe.txt; InfoAfterFile: builds\install\arch-specific\win32\readme.txt; +#endif + +[Messages] +en.BeveledLabel=English +#ifdef i18n +fr.BeveledLabel=Français +de.BeveledLabel=Deutsch +hu.BeveledLabel=Magyar +pt.BeveledLabel=Português +si.BeveledLabel=Slovenski +#endif + +[CustomMessages] +#include "custom_messages.inc" +#ifdef i18n +#include "fr\custom_messages_fr.inc" +#include "de\custom_messages_de.inc" +#include "hu\custom_messages_hu.inc" +#include "pt\custom_messages_pt.inc" +#include "si\custom_messages_si.inc" +#endif + +#ifdef iss_debug +; By default, the languages available at runtime depend on the user's +; code page. A user with the Western European code page set will not +; even see that we support installation with the Slovenian language +; for example. +; It can be useful when debugging to force the display of all available +; languages by setting LanguageCodePage to 0. Of course, if the langauge +; is not supported by the user's current code page it be unusable. +[LangOptions] +LanguageCodePage=0 +#endif + +[Types] +Name: SuperServerInstall; Description: {cm:SuperServerInstall} +Name: ClassicServerInstall; Description: {cm:ClassicServerInstall} +Name: DeveloperInstall; Description: {cm:DeveloperInstall} +Name: ClientInstall; Description: {cm:ClientInstall} +Name: CustomInstall; Description: {cm:CustomInstall}; Flags: iscustom; + +[Components] +Name: SuperServerComponent; Description: {cm:SuperServerComponent}; Types: SuperServerInstall; Flags: exclusive; +Name: ClassicServerComponent; Description: {cm:ClassicServerComponent}; Types: ClassicServerInstall; Flags: exclusive; +Name: ServerComponent; Description: {cm:ServerComponent}; Types: SuperServerInstall ClassicServerInstall; +Name: DevAdminComponent; Description: {cm:DevAdminComponent}; Types: SuperServerInstall ClassicServerInstall DeveloperInstall; +Name: ClientComponent; Description: {cm:ClientComponent}; Types: SuperServerInstall ClassicServerInstall DeveloperInstall ClientInstall CustomInstall; Flags: fixed disablenouninstallwarning; + +[Tasks] +;Server tasks +Name: UseGuardianTask; Description: {cm:UseGuardianTask}; Components: ServerComponent; MinVersion: 4.0,4.0; Check: ConfigureFirebird; +Name: UseApplicationTask; Description: {cm:UseApplicationTaskMsg}; GroupDescription: {cm:TaskGroupDescription}; Components: ServerComponent; MinVersion: 4,4; Flags: exclusive; Check: ConfigureFirebird; +Name: UseServiceTask; Description: {cm:UseServiceTask}; GroupDescription: {cm:TaskGroupDescription}; Components: ServerComponent; MinVersion: 0,4; Flags: exclusive; Check: ConfigureFirebird; +Name: AutoStartTask; Description: {cm:AutoStartTask}; Components: ServerComponent; MinVersion: 4,4; Check: ConfigureFirebird; +;Name: MenuGroupTask; Description: Create a Menu &Group; Components: DevAdminComponent; MinVersion: 4,4 +;Copying of client libs to +Name: CopyFbClientToSysTask; Description: {cm:CopyFbClientToSysTask}; Components: ClientComponent; MinVersion: 4,4; Flags: Unchecked; Check: ShowCopyFbClientLibTask; +Name: CopyFbClientAsGds32Task; Description: {cm:CopyFbClientAsGds32Task}; Components: ClientComponent; MinVersion: 4,4; Check: ShowCopyGds32Task; +;Allow user to not install cpl applet +Name: InstallCPLAppletTask; Description: {cm:InstallCPLAppletTask}; Components: SuperServerComponent; MinVersion: 4.0,4.0; Check: ShowInstallCPLAppletTask; + + +[Run] +;Always register Firebird +Filename: {app}\bin\instreg.exe; Parameters: "install "; StatusMsg: {cm:instreg}; MinVersion: 4.0,4.0; Components: ClientComponent; Flags: runminimized + +Filename: {app}\bin\instclient.exe; Parameters: "install fbclient"; StatusMsg: {cm:instclientCopyFbClient}; MinVersion: 4.0,4.0; Components: ClientComponent; Flags: runminimized; Check: CopyFBClientLib; +Filename: {app}\bin\instclient.exe; Parameters: "install gds32"; StatusMsg: {cm:instclientGenGds32}; MinVersion: 4.0,4.0; Components: ClientComponent; Flags: runminimized; Check: CopyGds32 + + +;If on NT/Win2k etc and 'Install and start service' requested +Filename: {app}\bin\instsvc.exe; Parameters: "install {code:ServiceStartFlags|""""} "; StatusMsg: {cm:instsvcSetup}; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized; Tasks: UseServiceTask; Check: ConfigureFirebird; +Filename: {app}\bin\instsvc.exe; Description: {cm:instsvcStartQuestion}; Parameters: start; StatusMsg: {cm:instsvcStartMsg}; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized postinstall; Tasks: UseServiceTask; Check: StartEngine + +;If 'start as application' requested +Filename: {code:StartApp|{app}\bin\fbserver.exe}; Description: {cm:instappStartQuestion}; Parameters: -a; StatusMsg: {cm:instappStartMsg}; MinVersion: 0,4.0; Components: ServerComponent; Flags: nowait postinstall; Tasks: UseApplicationTask; Check: StartEngine + + +[Registry] +;If user has chosen to start as App they may well want to start automatically. That is handled by a function below. +;Unless we set a marker here the uninstall will leave some annoying debris. +Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: Firebird; ValueData: ; Flags: uninsdeletevalue; Tasks: UseApplicationTask; Check: ConfigureFirebird; + +;This doesn't seem to get cleared automatically by instreg on uninstall, so lets make sure of it +Root: HKLM; Subkey: "SOFTWARE\Firebird Project"; Flags: uninsdeletekeyifempty; Components: ClientComponent DevAdminComponent ServerComponent + +;Clean up Invalid registry entries from previous installs. +Root: HKLM; Subkey: "SOFTWARE\FirebirdSQL"; ValueType: none; Flags: deletekey; + +;User _may_ be installing over an existing 1.5 install, and it may have been set to run as application on startup +;so we had better delete this entry unless they have chosen to autostart as application +; - except that this seems to be broken. Bah! +;Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; Valuetype: none; ValueName: 'Firebird'; ValueData: ''; flags: deletevalue; Check: IsNotAutoStartApp; +[Icons] +Name: {group}\Firebird Server; Filename: {app}\bin\fb_inet_server.exe; Parameters: -a; Flags: runminimized; MinVersion: 4.0,4.0; Check: InstallServerIcon; IconIndex: 0; Components: ClassicServerComponent; Comment: Run Firebird classic server (without guardian) +Name: {group}\Firebird Server; Filename: {app}\bin\fbserver.exe; Parameters: -a; Flags: runminimized; MinVersion: 4.0,4.0; Check: InstallServerIcon; IconIndex: 0; Components: SuperServerComponent; Comment: Run Firebird Superserver (without guardian) +Name: {group}\Firebird Guardian; Filename: {app}\bin\fbguard.exe; Parameters: -a; Flags: runminimized; MinVersion: 4.0,4.0; Check: InstallGuardianIcon; IconIndex: 1; Components: SuperServerComponent; Comment: Run Firebird Super Server (with guardian) +Name: {group}\Firebird Guardian; Filename: {app}\bin\fbguard.exe; Parameters: -c; Flags: runminimized; MinVersion: 4.0,4.0; Check: InstallGuardianIcon; IconIndex: 1; Components: ClassicServerComponent; Comment: Run Firebird Classic Server (with guardian) +#define App_Name = SetupSetting("AppName") +Name: {group}\Firebird 2.0.0 Release Notes; Filename: {app}\doc\Firebird_v2.0.0.ReleaseNotes.pdf; MinVersion: 4.0,4.0; Comment: {#App_Name} {cm:ReleaseNotes} +Name: {group}\Firebird 1.5.2 Release Notes; Filename: {app}\doc\Firebird_v1.5.2.ReleaseNotes.pdf; MinVersion: 4.0,4.0; Comment: {#App_Name} {cm:ReleaseNotes} +Name: {group}\Firebird 1.5.1 Release Notes; Filename: {app}\doc\Firebird_v1.5.1.ReleaseNotes.pdf; MinVersion: 4.0,4.0; Comment: {#App_Name} {cm:ReleaseNotes} +Name: {group}\Firebird 1.5 Release Notes; Filename: {app}\doc\Firebird_v1.5.ReleaseNotes.pdf; MinVersion: 4.0,4.0; Comment: {#App_Name} {cm:ReleaseNotes} +;Always install the original english version +Name: {group}\Firebird 2.0.0 Readme; Filename: {app}\readme.txt; MinVersion: 4.0,4.0; +#ifdef i18n +;And install translated readme.txt if non-default language is chosen. +Name: {group}\{cm:IconReadme}; Filename: {app}\{cm:ReadMeFile}; MinVersion: 4.0,4.0; Components: DevAdminComponent; Check: NonDefaultLanguage; +#endif +Name: {group}\Uninstall Firebird; Filename: {uninstallexe}; Comment: Uninstall Firebird + +[Files] +#ifdef files +Source: builds\install\misc\IPLicense.txt; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion; +Source: builds\install\misc\IDPLicense.txt; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion +;Always install the original english version +Source: builds\install\arch-specific\win32\readme.txt; DestDir: {app}; Components: DevAdminComponent; Flags: ignoreversion; +#ifdef i18n +;Translated files +Source: src\install\arch-specific\win32\fr\*.txt; DestDir: {app}\doc; Components: DevAdminComponent; Flags: ignoreversion; Languages: fr; +Source: src\install\arch-specific\win32\de\*.txt; DestDir: {app}\doc; Components: DevAdminComponent; Flags: ignoreversion; Languages: de; +Source: src\install\arch-specific\win32\hu\*.txt; DestDir: {app}\doc; Components: DevAdminComponent; Flags: ignoreversion; Languages: hu; +Source: src\install\arch-specific\win32\pt\*.txt; DestDir: {app}\doc; Components: DevAdminComponent; Flags: ignoreversion; Languages: pt; +Source: src\install\arch-specific\win32\si\*.txt; DestDir: {app}\doc; Components: DevAdminComponent; Flags: ignoreversion; Languages: si; +#endif +Source: output\firebird.conf; DestDir: {app}; DestName: firebird.conf; Components: ServerComponent; Flags: uninsneveruninstall; check: SaveFirebirdConf +Source: output\aliases.conf; DestDir: {app}; Components: ClientComponent; Flags: uninsneveruninstall onlyifdoesntexist +Source: output\security.fdb; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall onlyifdoesntexist +Source: output\security.fbk; DestDir: {app}; Components: ServerComponent; Flags: ignoreversion +Source: output\firebird.msg; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion +Source: output\firebird.log; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall skipifsourcedoesntexist external dontcopy + +Source: output\bin\gbak.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: sharedfile ignoreversion +Source: output\bin\gdef.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion +Source: output\bin\gfix.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: sharedfile ignoreversion +Source: output\bin\gpre.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion +Source: output\bin\gsec.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: sharedfile ignoreversion +Source: output\bin\gsplit.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: sharedfile ignoreversion +Source: output\bin\gstat.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion +Source: output\bin\fbguard.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion +Source: output\bin\fb_lock_print.exe; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion +Source: output\bin\fb_inet_server.exe; DestDir: {app}\bin; Components: ClassicServerComponent; Flags: sharedfile ignoreversion +Source: output\bin\fbserver.exe; DestDir: {app}\bin; Components: SuperServerComponent; Flags: sharedfile ignoreversion +Source: output\bin\ib_util.dll; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion +Source: output\bin\instclient.exe; DestDir: {app}\bin; Components: ClientComponent; Flags: sharedfile ignoreversion +Source: output\bin\instreg.exe; DestDir: {app}\bin; Components: ClientComponent; Flags: sharedfile ignoreversion +Source: output\bin\instsvc.exe; DestDir: {app}\bin; Components: ServerComponent; MinVersion: 0,4.0; Flags: sharedfile ignoreversion +Source: output\bin\isql.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion +Source: output\bin\qli.exe; DestDir: {app}\bin; Components: DevAdminComponent; Flags: ignoreversion +Source: output\bin\fbclient.dll; DestDir: {app}\bin; Components: ClientComponent; Flags: overwritereadonly sharedfile promptifolder +Source: output\bin\security_database.sql; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion + +; Install MS libs locally if Win2K or later, else place in if NT4 or Win95/98/ME. +; NOTE: These dll's MUST never be sourced from the local system32 directory. +; Deploy libraries from vcredist if MSVC6 is used. Use %FrameworkSDKDir% is compiling with Visual Studio. +; The BuildExecutableInstall.bat will attempt to locate them and place them in output\system32\ +#if msvc_version == 6 +Source: output\system32\msvcrt.dll; DestDir: {app}\bin; Components: ClientComponent; MinVersion: 0,5.0; +Source: output\system32\msvcrt.dll; DestDir: {sys}; Components: ClientComponent; OnlyBelowVersion: 5.0,5.0; Flags: sharedfile onlyifdoesntexist uninsneveruninstall; +#elif msvc_version == 7 +Source: output\system32\msvcr{#msvc_version}?.dll; DestDir: {app}\bin; Components: ClientComponent; MinVersion: 0,5.0; +Source: output\system32\msvcr{#msvc_version}?.dll; DestDir: {sys}; Components: ClientComponent; OnlyBelowVersion: 5.0,5.0; Flags: sharedfile uninsneveruninstall; +#endif +Source: output\system32\msvcp{#msvc_version}?.dll; DestDir: {app}\bin; Components: ClientComponent; MinVersion: 0,5.0; +Source: output\system32\msvcp{#msvc_version}?.dll; DestDir: {sys}; Components: ClientComponent; OnlyBelowVersion: 5.0,5.0; Flags: sharedfile uninsneveruninstall; + +;Docs +Source: output\doc\*.*; DestDir: {app}\doc; Components: DevAdminComponent; Flags: skipifsourcedoesntexist ignoreversion +Source: output\doc\sql.extensions\*.*; DestDir: {app}\doc\sql.extensions; Components: DevAdminComponent; Flags: skipifsourcedoesntexist ignoreversion + +Source: output\help\*.*; DestDir: {app}\help; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\include\*.*; DestDir: {app}\include; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\intl\fbintl.dll; DestDir: {app}\intl; Components: ServerComponent; Flags: sharedfile ignoreversion; +Source: output\lib\*.*; DestDir: {app}\lib; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\UDF\ib_udf.dll; DestDir: {app}\UDF; Components: ServerComponent; Flags: sharedfile ignoreversion; +Source: output\UDF\fbudf.dll; DestDir: {app}\UDF; Components: ServerComponent; Flags: sharedfile ignoreversion; +Source: output\UDF\*.sql; DestDir: {app}\UDF; Components: ServerComponent; Flags: ignoreversion; + +;Note - Win9x requires 8.3 filenames for the uninsrestartdelete option to work +;FIXME Source: output\system32\Firebird2Control.cpl; DestDir: {sys}; Components: SuperServerComponent; MinVersion: 0,4.0; Flags: sharedfile ignoreversion promptifolder restartreplace uninsrestartdelete; Check: InstallCPLApplet +;FIXME Source: output\system32\Firebird2Control.cpl; DestDir: {sys}\FIREBI~1.CPL; Components: SuperServerComponent; MinVersion: 4.0,0; Flags: sharedfile ignoreversion promptifolder restartreplace uninsrestartdelete; Check: InstallCPLApplet +#endif +#ifdef examples +Source: output\examples\*.*; DestDir: {app}\examples; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\examples\api\*.*; DestDir: {app}\examples\api; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\examples\build_win32\*.*; DestDir: {app}\examples\build_win32; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\examples\dyn\*.*; DestDir: {app}\examples\dyn; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\examples\empbuild\*.*; DestDir: {app}\examples\empbuild; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\examples\include\*.*; DestDir: {app}\examples\include; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\examples\stat\*.*; DestDir: {app}\examples\stat; Components: DevAdminComponent; Flags: ignoreversion; +Source: output\examples\udf\*.*; DestDir: {app}\examples\udf; Components: DevAdminComponent; Flags: ignoreversion; +#endif + +#ifdef ship_pdb +Source: output\bin\fbclient.pdb; DestDir: {app}\bin; Components: ClientComponent; +Source: output\bin\fb_inet_server.pdb; DestDir: {app}\bin; Components: ClassicServerComponent; +Source: output\bin\fbserver.pdb; DestDir: {app}\bin; Components: SuperServerComponent; +#endif + +[UninstallRun] +Filename: {app}\bin\instsvc.exe; Parameters: " stop"; StatusMsg: {cm:instsvcStopMsg}; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized; Tasks: UseServiceTask; RunOnceId: StopService +Filename: {app}\bin\instsvc.exe; Parameters: " remove"; StatusMsg: {cm:instsvcRemove}; MinVersion: 0,4.0; Components: ServerComponent; Flags: runminimized; Tasks: UseServiceTask; RunOnceId: RemoveService +Filename: {app}\bin\instclient.exe; Parameters: " remove gds32"; StatusMsg: {cm:instclientDecLibCountGds32}; MinVersion: 4.0,4.0; Flags: runminimized; +Filename: {app}\bin\instclient.exe; Parameters: " remove fbclient"; StatusMsg: {cm:instclientDecLibCountFbClient}; MinVersion: 4.0,4.0; Flags: runminimized; +Filename: {app}\bin\instreg.exe; Parameters: " remove"; StatusMsg: {cm:instreg}; MinVersion: 4.0,4.0; Flags: runminimized; RunOnceId: RemoveRegistryEntry + +[UninstallDelete] +Type: files; Name: {app}\*.lck +Type: files; Name: {app}\*.evn + + +[_ISTool] +EnableISX=true + +[Code] +program Setup; + +//Var +// ProductVersion = '1.5.0'; + +// Some global variables are also in FirebirdInstallEnvironmentChecks.inc +// This is not ideal, but then this scripting environment is not ideal, either. +// The basic point of the include files is to isolate chunks of code that are +// a) Form a module or have common functionality +// b) Debugged. +// This hopefully keeps the main script simpler to follow. + +Var + InstallRootDir: String; + FirebirdConfSaved: String; + ForceInstall: Boolean; // If /force set on command-line we install _and_ + // configure. Default is to install and configure only if + // no other working installation is found (unless we are installing + // over the same version) + + //These three command-line options change the default behaviour + // during a scripted install + // They also control whether their associated task checkboxes are displayed + // during an interactive install + NoCPL: Boolean; // pass /nocpl on command-line. + NoLegacyClient: Boolean; // pass /nogds32 on command line. + CopyFbClient: Boolean; // pass /copyfbclient on command line. + + +#include "FirebirdInstallSupportFunctions.inc" +#include "FirebirdInstallEnvironmentChecks.inc" + + +function SummarizeInstalledProducts: String; +var + InstallSummaryArray: TArrayofString; + product: Integer; + i: Integer; + StatusDescription: String; + InstallSummary: String; + prodstr: String; +begin + +//do nothing gracefully if we are called by accident. +if ProductsInstalledCount = 0 then + exit; + +SetArrayLength(InstallSummaryArray,ProductsInstalledCount); +for product := 0 to MaxProdInstalled -1 do begin + if (ProductsInstalledArray[product].InstallType <> NotInstalled) then begin + InstallSummaryArray[i] := Format1(ProductsInstalledArray[product].Description, + ProductsInstalledArray[product].ActualVersion); + + if (ProductsInstalledArray[product].ServerVersion <> '') then begin + if ((ProductsInstalledArray[product].InstallType AND ClassicServerInstall) = ClassicServerInstall) then + InstallSummaryArray[i] := InstallSummaryArray[i] + ' '+ExpandConstant('{cm:ClassicServerInstall}') + else + InstallSummaryArray[i] := InstallSummaryArray[i] + ' '+ExpandConstant('{cm:SuperServerInstall}') + end + else begin + if (ProductsInstalledArray[product].GBAKVersion <> '') then + InstallSummaryArray[i] := InstallSummaryArray[i] + ' '+ExpandConstant('{cm:DeveloperInstall}') + else + InstallSummaryArray[i] := InstallSummaryArray[i] + ' '+ExpandConstant('{cm:ClientInstall}') + end; + + if ((ProductsInstalledArray[product].InstallType AND BrokenInstall) = BrokenInstall) then + InstallSummaryArray[i] := InstallSummaryArray[i] + + #13 + ExpandConstant('{cm:PreviousInstallBroken}') + else + InstallSummaryArray[i] := InstallSummaryArray[i] + + #13 + ExpandConstant('{cm:PreviousInstallGood}') + ; + + i:= i+1; + end; +end; + +for i:=0 to ProductsInstalledCount-1 do + InstallSummary := InstallSummary + InstallSummaryArray[i] + #13; + +//If FB2 is installed +If ((ProductsInstalled AND FB2) = FB2) then + InstallSummary := InstallSummary + +#13 + ExpandConstant('{cm:InstallSummarySuffix1}') + +#13 + ExpandConstant('{cm:InstallSummarySuffix2}') + +#13 + ExpandConstant('{cm:InstallSummarySuffix3}') + +#13 + ExpandConstant('{cm:InstallSummarySuffix4}') + +#13 +; + +if ProductsInstalledCount = 1 then + StatusDescription := Format2(ExpandConstant('{cm:InstallProducts}'), IntToStr(ProductsInstalledCount), ExpandConstant('{cm:InstalledProdCountSingular}')) +else + StatusDescription := Format2(ExpandConstant('{cm:InstallProducts}'), IntToStr(ProductsInstalledCount), ExpandConstant('{cm:InstalledProdCountPlural}')); + + Result := StatusDescription + +#13 + +#13 + InstallSummary + +#13 + ExpandConstant('{cm:InstallSummaryCancel1}') + +#13 + ExpandConstant('{cm:InstallSummaryCancel2}') + +#13 + +#13 + ExpandConstant('{cm:InstallSummaryCancel3}') + +#13 +end; + +function AnalysisAssessment: boolean; +var + MsgText: String; + MsgResult: Integer; +begin + result := false; + + //We've got all this information. What do we do with it? + + if ProductsInstalledCount = 0 then + //There is a possibility that all our efforts to detect an + //install were in vain and Firebird 1.5 _is_ running... + if ( FirebirdOneFiveRunning ) then begin + result := false; + MsgBox( #13+ExpandConstant('{cm:Fb15Running1}') + +#13 + +#13+ExpandConstant('{cm:Fb15Running2}') + +#13+ExpandConstant('{cm:Fb15Running3}') + +#13, mbError, MB_OK); + exit; + end + else begin + result := true; + exit; + end; + + //If Fb15 RC is installed then we can install over it. + //unless we find the server running. + if (ProductsInstalledCount = 1) AND + (((ProductsInstalled AND FB15) = FB15) OR + ((ProductsInstalled AND FB15RC) = FB15RC)) then + if ( FirebirdOneFiveRunning ) then begin + result := false; + MsgBox( #13+ExpandConstant('{cm:Fb15Running1}') + +#13 + +#13+ExpandConstant('{cm:Fb15Running2}') + +#13+ExpandConstant('{cm:Fb15Running3}') + +#13, mbError, MB_OK); + exit; + end + else begin + result := true; + exit; + end + ; + + if ForceInstall then begin + result := true; + exit; + end; + + //Otherwise, show user the analysis report. + MsgText := SummarizeInstalledProducts; + MsgResult := MsgBox(MsgText,mbConfirmation,MB_YESNO); + if (MsgResult = IDNO ) then + result := true; + //but we don't configure + if ((InstallAndConfigure AND Configure) = Configure) then + InstallAndConfigure := InstallAndConfigure - Configure; +end; + + +function InitializeSetup(): Boolean; +var + i: Integer; + CommandLine: String; +begin + + result := true; + + if not CheckWinsock2 then begin + result := False; + exit; + end + + CommandLine:=GetCmdTail; + if pos('FORCE',Uppercase(CommandLine))>0 then + ForceInstall:=True; + + if pos('NOCPL', Uppercase(CommandLine))>0 then + NoCPL := True; + + if pos('NOGDS32', Uppercase(CommandLine))>0 then + NoLegacyClient := True; + + if pos('COPYFBCLIENT', Uppercase(CommandLine))>0 then + CopyFbClient := True; + + //By default we want to install and confugure, + //unless subsequent analysis suggests otherwise. + InstallAndConfigure := Install + Configure; + + InitExistingInstallRecords; + AnalyzeEnvironment; + result := AnalysisAssessment; + + InstallRootDir := ''; + +end; + + +procedure DeInitializeSetup(); +var + ErrCode: Integer; +begin + // Did the install fail because winsock 2 was not installed? + if Winsock2Failure then + // Ask user if they want to visit the Winsock2 update web page. + if MsgBox(ExpandConstant('{cm:Winsock2Web1}')+#13#13+ExpandConstant('{cm:Winsock2Web2}'), mbInformation, MB_YESNO) = idYes then + // User wants to visit the web page + InstShellExec(sMSWinsock2Update, '', '', SW_SHOWNORMAL, ErrCode); +end; + + +//This function tries to find an existing install of Firebird 1.5 +//If it succeeds it suggests that directory for the install +//Otherwise it suggests the default for Fb 1.5 +function ChooseInstallDir(Default: String): String; +var + InterBaseRootDir, + FirebirdRootDir: String; +begin + //The installer likes to call this FOUR times, which makes debugging a pain, + //so let's test for a previous call. + if (InstallRootDir = '') then begin + + // Try to find the value of "RootDirectory" in the Firebird + // registry settings. This is either where Fb 1.0 exists or Fb 1.5 + InterBaseRootDir := GetInterBaseDir; + FirebirdRootDir := GetFirebirdDir; + + if (FirebirdRootDir <> '') and ( FirebirdRootDir = InterBaseRootDir ) then //Fb 1.0 must be installed so don't overwrite it. + InstallRootDir := Default; + + if (( InstallRootDir = '' ) and + ( FirebirdRootDir = Default )) then // Fb 1.5 is already installed, + InstallRootDir := Default; // so we offer to install over it + + if (( InstallRootDir = '') and + ( FirebirdVer[0] = 1 ) and ( FirebirdVer[1] = 5 ) ) then // Firebird 1.5 is installed + InstallRootDir := FirebirdRootDir; // but the user has changed the default + + // if we haven't found anything then try the FIREBIRD env var + // User may have preferred location for Firebird, but has possibly + // uninstalled previous version + if (InstallRootDir = '') then + InstallRootDir:=getenv('FIREBIRD'); + + //if no existing locations found make sure we default to the default. + if (InstallRootDir = '') then + InstallRootDir := Default; + + end; // if InstallRootDir = '' then begin + + Result := ExpandConstant(InstallRootDir); + +end; + + +function ServiceStartFlags(Default: String): String; +var + ServerType: String; + SvcParams: String; +begin + servertype := ''; + SvcParams := ''; + if ClassicInstallChosen then + ServerType := ' -classic ' + else + ServerType := ' -superserver '; + + + if ShouldProcessEntry('ServerComponent', 'AutoStartTask')= srYes then + SvcParams := ' -auto ' + else + SvcParams := ' -demand '; + + if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srYes then + SvcParams := SvcParams + ServerType + ' -guardian' + else + SvcParams := SvcParams + ServerType; + + Result := SvcParams; +end; + +function InstallGuardianIcon(): Boolean; +begin + result := false; + if ShouldProcessEntry('ServerComponent', 'UseApplicationTask')= srYes then + if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srYes then + result := true; +end; + +function InstallServerIcon(): Boolean; +begin + result := false; + if ShouldProcessEntry('ServerComponent', 'UseApplicationTask')= srYes then + if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srNo then + result := true; +end; + +function StartApp(Default: String): String; +begin + if ShouldProcessEntry('ServerComponent', 'UseGuardianTask')= srYes then begin + Result := GetAppPath+'\bin\fbguard.exe'; + if ClassicInstallChosen then + Result := Result + ' -c'; + end + else + if ClassicInstallChosen then + Result := GetAppPath+'\bin\fb_inet_server.exe' + else + Result := GetAppPath+'\bin\fbserver.exe'; + + +end; + +function IsNotAutoStartApp: boolean; +//Support function to help remove unwanted registry entry. +begin + result := true; + if ( ShouldProcessEntry('ServerComponent', 'AutoStartTask')= srYes) and + ( ShouldProcessEntry('ServerComponent', 'UseApplicationTask')= srYes ) then + result := false; +end; + + +procedure RemoveSavedConfIfNoDiff; +//Compare firebird.conf with the one we just saved. +//If they match then we can remove the saved one. +var + FirebirdConfStr: String; + SavedConfStr: String; +begin + LoadStringFromFile( GetAppPath+'\firebird.conf', FirebirdConfStr ); + LoadStringFromFile( FirebirdConfSaved, SavedConfStr ); + + if CompareStr( FirebirdConfStr, SavedConfStr ) = 0 then + DeleteFile( FirebirdConfSaved ); +end; + +procedure UpdateFirebirdConf; +// Update firebird conf. If user has deselected the guardian we should update +// firebird.conf accordingly. Otherwise we leave the file unchanged. +var + fbconf: TArrayOfString; + i, position: Integer; + ArraySize: Integer; + FileChanged: boolean; +begin + //There is no simple, foolproof and futureproof way to check whether + //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 ShouldProcessEntry('ServerComponent', 'UseGuardianTask') = srNo then + ReplaceLine(GetAppPath+'\firebird.conf','GuardianOption','GuardianOption = 0','#'); + end; +end; + + +procedure CurPageChanged(CurPage: Integer); +begin + case CurPage of + wpInfoBefore: WizardForm.INFOBEFOREMEMO.font.name:='Courier New'; + wpInfoBefore: WizardForm.INFOAFTERMEMO.font.name:='Courier New'; + wpSelectTasks: WizardForm.TASKSLIST.height := WizardForm.TASKSLIST.height+30; + wpFinished: ; // Create some links to Firebird and IBP here?. + end; +end; + + +procedure CurStepChanged(CurStep: Integer); +var + AppStr: String; +begin + case CurStep of + csCopy: begin + SetupSharedFilesArray; + GetSharedLibCountBeforeCopy; + end; + + csFinished: begin + //If user has chosen to install an app and run it automatically set up the registry accordingly + //so that the server or guardian starts evertime they login. + if (ShouldProcessEntry('ServerComponent', 'AutoStartTask')= srYes) and + ( ShouldProcessEntry('ServerComponent', 'UseApplicationTask')= srYes ) then begin + AppStr := StartApp('')+' -a'; + RegWriteStringValue (HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run', 'Firebird', AppStr); + end; + + RemoveSavedConfIfNoDiff; + UpdateFirebirdConf; + CheckSharedLibCountAtEnd; + + end; + end; +end; + +function StartEngine: boolean; +begin + if ConfigureFirebird then + result := not FirebirdOneRunning; +end; + + +function ChooseUninstallIcon(Default: String): String; +begin + if ClassicInstallChosen then + result := GetAppPath+'\bin\fb_inet_server.exe' + else + result := GetAppPath+'\bin\fbserver.exe'; + +end; + +function SaveFirebirdConf: boolean; +// If we are installing over an existing installation we save the original +// config file. This is so that we don't have to worry about a conflict between +// the users configuration and the configuration expected by the installer. We +// always use the standard configuration and let the user sort out any problems +// later. We could do things the other way round, but then we would have to read +// the existing config file and dynamically set install options (like use of +// guardian). This will quickly start to get way too complicated. +var + NewFileName: String; + i: Integer; +begin +//for some reason the 3.0.6 installer wants to call this twice +//so we need to check. +if FirebirdConfSaved = '' then begin + if fileexists(GetAppPath+'\firebird.conf') then begin + i:=0; + // 999 previous installs ought to be enough :-) + while i < 999 do begin + NewFileName := GetAppPath+'\firebird.conf.saved.'+IntToStr(i); + if fileexists(NewFileName) then + i := i + 1 + else + break; + end; + + filecopy( GetAppPath+'\firebird.conf', NewFileName, false ); + FirebirdConfSaved := NewFileName; + end +end + +//Always return true +result := true; +end; + + +begin +end. + + + diff --git a/builds/install/arch-specific/win32/custom_messages.inc b/builds/install/arch-specific/win32/custom_messages.inc new file mode 100644 index 0000000000..19a48f8c97 --- /dev/null +++ b/builds/install/arch-specific/win32/custom_messages.inc @@ -0,0 +1,69 @@ +en.MyAppName=Firebird Database Server 2.0 +en.SuperServerInstall=Full installation of Super Server and development tools. +en.ClassicServerInstall=Full installation of Classic Server and development tools. +en.DeveloperInstall=Installation of Client tools for Developers and database administrators. +en.ClientInstall=Minimum client install - no server, no tools. +en.CustomInstall=Custom installation +en.SuperServerComponent=Super Server binary +en.ClassicServerComponent=Classic Server binary +en.ServerComponent=Server components +en.DevAdminComponent=Developer and admin tools components +en.ClientComponent=Client components +en.UseGuardianTask=Use the &Guardian to control the server? +en.UseApplicationTaskMsg=Run as an &Application? +en.TaskGroupDescription=Run Firebird server as: +en.UseServiceTask=Run as a &Service? +en.AutoStartTask=Start &Firebird automatically everytime you boot up? +en.CopyFbClientToSysTask=Copy &Firebird client library to directory? +en.CopyFbClientAsGds32Task=Generate client library as GDS32.DLL for &legacy app. support? +en.InstallCPLAppletTask="Install Control &Panel Applet?" +en.instreg=Updating the registry +en.instclientCopyFbClient=Copying fbclient to the directory +en.instclientGenGds32=Generating gds32.dll for directory +en.instclientDecLibCountGds32="Decrementing shared lib count for gds32 and removing it if appropriate." +en.instclientDecLibCountFbClient="Decrementing shared lib count for fbclient and removing it if appropriate." +en.instsvcSetup=Setting up the service +en.instsvcStartQuestion=Start Firebird Service now? +en.instsvcStartMsg=Starting the server +en.instsvcStopMsg="Stopping the service" +en.instsvcRemove="Removing the service" +en.instappStartQuestion=Start Firebird now? +en.instappStartMsg=Starting the server + +en.InstallSummarySuffix1=This version of Firebird will become the default install. +en.InstallSummarySuffix2=Also, take note that installing this version of Firebird +en.InstallSummarySuffix3= when a later version is already installed may lead to +en.InstallSummarySuffix4= unpredictable results. + +en.InstallSummaryCancel1= If you continue with this installation Firebird will be installed but not configured. +en.InstallSummaryCancel2= You will have to complete installation manually. +en.InstallSummaryCancel3= Do you want to CANCEL this installation? + +en.InstalledProducts='re-installation analysis indicates that %s existing Firebird or Interbase %s been found. +en.InstalledProdCountSingular=version has +en.InstalledProdCountPlural=versions have + +en.Fb15Running1=An existing Firebird 1.5 or 2.0 Server is running. +en.Fb15Running2= You must close the application or stop the +en.Fb15Running3= service before continuing. + +en.PreviousInstallBroken= (Install appears broken due to version string mismatch.) +en.PreviousInstallGood= (Installation appears to be correct.) + +en.IconReadme=Firebird 2.0 Readme +en.IconUninstall=Uninstall Firebird +en.ReleaseNotes= release notes. (Requires Acrobat Reader.) +en.Uninstall=Uninstall Firebird +en.Winsock2Web1=Winsock 2 is not installed. +en.Winsock2Web2=Would you like to Visit the Winsock 2 Update Home Page? +en.NoWinsock2 = Please Install Winsock 2 Update before continuing +en.MSWinsock2Update = http://www.microsoft.com/windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp + +en.RunCSNoGuardian=Run Firebird classic server (without guardian) +en.RunSSNoGuardian=Run Firebird Superserver (without guardian) +en.RunSSWithGuardian=Run Firebird Super Server (with guardian) +en.RunCSWithGuardian=Run Firebird Classic Server (with guardian) +en.RunISQL=Run command-line based Interactive SQL tool + +en.ReadmeFile=readme.txt +en.InstallationReadmeFile=installation_readme.txt diff --git a/builds/install/arch-specific/win32/i18n_readme.txt b/builds/install/arch-specific/win32/i18n_readme.txt new file mode 100644 index 0000000000..85b7c4fdb4 --- /dev/null +++ b/builds/install/arch-specific/win32/i18n_readme.txt @@ -0,0 +1,138 @@ +Internationalization (I18N) of the Win32 installer. +=================================================== + +The intention of adding internationalization to the Win32 Firebird +installer is to provide a minimum level of translation to support +the installation process only. This means just translating the install +dialogues, the readme file and the installation readme file. All other +documentatation i18n should be available separately. I18n is a +good thing, but bloating the installer with large amounts of translated +documentation is not desirable. + +The current version of InnoSetup - 4.2.7 - provides generic support for +the following languages: + + Catalan, Czech, Dutch, French, German, Norwegian, Polish, + PortugueseStd, Russian and Slovenian. + +In addition, the InnoSetup user community has made other language packs +available for download. See here for details: + + http://www.jrsoftware.org/files/istrans/ + +Therefore adding i18n support to the Firebird installer is extremely +simple as all we need are translations of the Firebird specific messages. + +Currently the Firebird installer has support for English, French, German +Portuguese (standard), Hungarian and Slovenian installs. So there are still +opportunities for others to provide support for their native language. + + +How to add new languages +------------------------ + +The simplest way to understand this is to study the implementation of +the French translation. The steps to follow are these: + +o The Win32 install files are located in install\arch-specific\win32. + This sub-directory is located as follows: + + Firebird 1.5 - firebird2\src + Firebird 2.0 - firebird2\builds + +o You can use anonymous CVS to checkout the Win32 install kit with these + commands: + + [login] + + cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/firebird login + + [checkout the Fb 1.5 Win32 installation kit] + + cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/firebird co -r B1_5_Release firebird2/src/install/arch-specific/win32 + + [checkout the Fb 2.0 Win32 installation kit (When it is ready)] + + cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/firebird co firebird2/builds/install/arch-specific/win32 + + +o Each language has its own sub-directory under install\arch-specific\win32. + If possible a two-letter language code should be used for the + directory name. This two letter code should, if possible, be the + internationally recognised two-letter identifier for the langauge. + + +o Three files are required: + + * custom_messages_%LANG_CODE%.inc + + where %LANG_CODE% represents the language identifier used in the + directory name. This file contains the translated strings that are + used throughout the installation process. The original, english + strings are stored in install\arch-specific\win32\custom_messages.inc + + * readme.txt + + where the actual file name can be either in english or in the + translated equivalent of the name. The readme file stores last + minute documentation changes as well as general notes on using + firebird. It is displayed at the end of the installation process. + + The readme file is always subject to change from one beta or + pre-release to the next (or final release.) For this reason the + translated readme should always explain that the english language + readme.txt is the definitive version. This is because it will + not be possible to hold up a release while waiting for translators + to complete their work. + + * installation_readme.txt + + This filename can be translated or left with the original english + title. It contains installation specific details. It is displayed + near the beginning of the installation process. The installation + readme is usually static and only changes from point release to + point release. + + +o Issues to bear in mind + + * Use ascii characters for filenames where possible. + + * All strings that appear as text labels in dialogue screens should contain + an ampersand ( & ) to support keyboard input during setup. + + * The installation readme file and the readme file must be formatted to + a column width of 55 chars. Otherwise the installer will wrap lines + awkwardly. This is because the installer screens use the Courier New + font to display these text files. Courier New guarantees to maintain + column alignment. + + +o Adding the new language to the InnoSetup install script + + Changes have been kept to the absolute minimum. Only the following + sections need to be altered: + + [Languages] + Name: en; MessagesFile: compiler:Default.isl; InfoBeforeFile: output\doc\installation_readme.txt; InfoAfterFile: src\install\arch-specific\win32\readme.txt; + Name: fr; MessagesFile: compiler:Languages\French.isl; InfoBeforeFile: src\install\arch-specific\win32\fr\installation_lisezmoi.txt; InfoAfterFile: src\install\arch-specific\win32\fr\lisezmoi.txt; + + [Messages] + en.BeveledLabel=English + fr.BeveledLabel=Français + + [CustomMessages] + #include "custom_messages.inc" + #include "fr\custom_messages_fr.inc" + + You are not required to make these changes. + + +o Submitting your changes + + All i18n is being co-ordinated by Paul Reeves who maintains the Win32 + installation kits. He can be contacted at: + + mailto: preeves at ibphoenix.com + + diff --git a/builds/install/arch-specific/win32/installation_scripted.txt b/builds/install/arch-specific/win32/installation_scripted.txt new file mode 100644 index 0000000000..6a1f508347 --- /dev/null +++ b/builds/install/arch-specific/win32/installation_scripted.txt @@ -0,0 +1,163 @@ + +Setup Command Line Parameters +============================= + +General parameters available to all InnoSetup based installers +-------------------------------------------------------------- + +The Setup program accepts optional command line parameters. These can +be useful to system administrators, and to other programs calling the +Setup program. + +These notes are applicable to version 4.2.7 of InnoSetup. +/SP- + Disables the 'This will install... Do you wish to continue?' prompt at + the beginning of Setup. Of course, this will have no effect if the + DisableStartupPrompt [Setup] section directive was set to yes. + + +/SILENT, /VERYSILENT + Instructs Setup to be silent or very silent. When Setup is silent the + wizard and the background window are not displayed but the installation + progress window is. When a setup is very silent this installation + progress window is not displayed. Everything else is normal so for + example error messages during installation are displayed and the startup + prompt is (if you haven't disabled it with DisableStartupPrompt or the '/SP-' command line option + explained above) + + If a restart is necessary and the '/NORESTART' command isn't used +(see below) and Setup is silent, it will display a Reboot now? + message box. If it's very silent it will reboot without asking. + + +/LOG + Causes Setup to create a log file in the user's TEMP directory + detailing file installation actions taken during the installation + process. This can be a helpful debugging aid. For example, if you + suspect a file isn't being replaced when you believe it should be (or + vice versa), the log file will tell you if the file was really + skipped, and why. + + The log file is created with a unique name based on the current date. + (It will not overwrite or append to existing files.) Currently, it is + not possible to customize the filename. + + The information contained in the log file is technical in nature and + therefore not intended to be understandable by end users. Nor is it + designed to be machine-parseable; the format of the file is subject + to change without notice. + + +/NOCANCEL + Prevents the user from cancelling during the installation process, + by disabling the Cancel button and ignoring clicks on the close + button. Useful along with '/SILENT' or '/VERYSILENT'. + + +/NORESTART + Instructs Setup not to reboot even if it's necessary. + + +/RESTARTEXITCODE=exit code + Specifies the custom exit code that Setup is to return when a restart + is needed. Useful along with '/NORESTART'. Also see Setup Exit Codes. + + +/LOADINF="filename" + Instructs Setup to load the settings from the specified file after + having checked the command line. This file can be prepared using the + '/SAVEINF=' command as explained below. + + o Don't forget to use quotes if the filename contains spaces. + + +/SAVEINF="filename" + Instructs Setup to save installation settings to the specified file. + + o Don't forget to use quotes if the filename contains spaces. + + +/LANG=language + Specifies the language to use. language specifies the internal name + of the language as specified in a [Languages] section entry. + + o When a valid /LANG parameter is used, the Select Language dialog will be suppressed. + + +/DIR="x:\dirname" + Overrides the default directory name displayed on the Select Destination + Location wizard page. A fully qualified pathname must be specified. + + +/GROUP="folder name" + Overrides the default folder name displayed on the Select Start Menu Folder + wizard page. If the [Setup] section directive DisableProgramGroupPage + was set to yes, this command line parameter is ignored. + + +/NOICONS + Instructs Setup to initially check the Don't create any icons check box + on the Select Start Menu Folder wizard page. + + +Parameters specific to Firebird installs +---------------------------------------- + +/COMPONENTS="comma separated list of component names" + + Choose from - SuperServerComponent, + ClassicServerComponent, + ServerComponent, + DevAdminComponent and + ClientComponent + + Overrides the default components settings. Using this command line + parameter causes Setup to automatically select a custom type. A full + install requires combining components. For example: + + /COMPONENTS="SuperServerComponent, ServerComponent, + DevAdminComponent, ClientComponent" + + would be required for a full install. + + +/FORCE + + Tells the installer to ignore its analysis of the existing + environment. It will attempt to install and configure Firebird 1.5 as + if no previous version of Firebird or InterBase was installed. + + This can be useful if you have a seriously broken installation that + you cannot uninstall. Or it could be another way to aggravate your + users by breaking a perfectly good working install of InterBase. Its + your choice. + + +/NOCPL + + Don't install the Control Panel Applet. This is useful for two + reasons: + + o Installing/Uninstalling the CPL applet requires a system + restart on Windows 2000 (and perhaps some other platforms.) + + o You may wish to use an alternative cpl applet. + + +/NOGDS32 + + Don't install a copy of the client library into the system directory, + even if installation analysis concludes it is OK to do so. + + +/COPYFBCLIENT + + Copy the fbclient.dll to the system directory. This is recommended + for client installs if you are sure that you will only ever be + accessing a single server version. If your client applications are + likely to take advantage of accessing different server versions this + is not recommended. See + doc/README.Win32LibraryInstallation.txt + for more information. + + diff --git a/builds/install/arch-specific/win32/setenvvar.bat b/builds/install/arch-specific/win32/setenvvar.bat deleted file mode 100644 index dcc37bb223..0000000000 --- a/builds/install/arch-specific/win32/setenvvar.bat +++ /dev/null @@ -1,35 +0,0 @@ -:: This bat set the environment values -:: ROOT_PATH dos format path of the main directory -:: DB_PATH unix format path of the main directory -:: VS_VER VisualStudio version (msvc6|msvc7) - -@echo off -::================= -:SET_DB_DIR - -@cd ..\..\..\.. -@for /f "delims=" %%a in ('@cd') do (set ROOT_PATH=%%a) -@cd %~dp0 -for /f "tokens=*" %%a in ('@echo %ROOT_PATH:\=/%') do (set DB_PATH=%%a) - -@msdev /? >nul 2>nul -@if not errorlevel 9009 ((set MSVC_VERSION=6) & (goto :END)) - -@devenv /? >nul 2>nul -@if not errorlevel 9009 ((set MSVC_VERSION=7) & (goto :END)) - -::=========== -:HELP -@echo. -@echo ERROR: There are not a visual studio valid version in your path. -@echo You need visual studio 6 or 7 to build Firebird -@echo. -:: set errorlevel -@exit /B 1 - -:END -@echo. -@echo msvc_version=%MSVC_VERSION% -@echo db_path=%DB_PATH% -@echo root_path=%ROOT_PATH% -@echo. \ No newline at end of file