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

Add support to deploy VCRT libraries via msi, if windows installer 3.0 is available.

This commit is contained in:
paul_reeves 2007-12-21 12:10:16 +00:00
parent e6f7f835f1
commit 512f5f881a
5 changed files with 230 additions and 42 deletions

View File

@ -131,6 +131,12 @@ if %FBBUILD_ISX_PACK% EQU 1 (
) else (@echo o Inno Setup found at %INNO5_SETUP_PATH%.)
)
if not defined WIX (
call :ERROR WIX not defined. WiX is needed to build the MSI kits of the CRT runtimes.
@goto :EOF
) else (@echo o WiX found at %WIX%.)
)
::End of CHECK_ENVIRONMENT
::------------------------
@goto :EOF
@ -351,6 +357,22 @@ for /R %FB_OUTPUT_DIR%\doc %%v in (.) do (
@goto :EOF
:BUILD_CRT_MSI
:: Generate runtimes as an MSI file.
:: This requires WiX to be installed
::============
if %MSVC_VERSION% GEQ 8 (
if not exist %FB_OUTPUT_DIR%\system32\vccrt%MSVC_VERSION%_%FB_TARGET_PLATFORM%.msi (
%WIX%\candle.exe -v0 %FB_ROOT_PATH%\builds\win32\msvc%MSVC_VERSION%\VCCRT_%FB_TARGET_PLATFORM%.wxs -out %FB_GEN_DIR%\vccrt_%FB_TARGET_PLATFORM%.wixobj
%WIX%\light.exe %FB_GEN_DIR%\vccrt_%FB_TARGET_PLATFORM%.wixobj -out %FB_OUTPUT_DIR%\system32\vccrt%MSVC_VERSION%_%FB_TARGET_PLATFORM%.msi
))
::End of BUILD_CRT_MSI
::--------------------
@goto :EOF
:IBASE_H
:: Concatenate header files into ibase.h
::======================================
@ -516,8 +538,8 @@ if "%FBBUILD_SHIP_PDB%" == "ship_pdb" (
)
@%SEVENZIP%\7z.exe a -r -tzip -mx9 %FBBUILD_ZIPFILE% %FBBUILD_ZIP_PACK_ROOT%\*.*
::End of ZIP_PACK
@echo End of ZIP_PACK
@echo.
::----------------
@goto :EOF
@ -575,7 +597,6 @@ for %%v in (IPLicense.txt IDPLicense.txt ) do (
:EMB_PACK
::=======
if %FBBUILD_EMB_PACK% EQU 0 goto :EOF
@echo Now building embedded package
:: Now we can zip it up and copy the package to the install images directory.
if "%FBBUILD_SHIP_PDB%" == "ship_pdb" (
@del %FBBUILD_INSTALL_IMAGES%\%FBBUILD_FILE_ID%_embed_win32_pdb.zip > nul
@ -588,7 +609,8 @@ if "%FBBUILD_SHIP_PDB%" == "ship_pdb" (
@%SEVENZIP%\7z.exe a -r -tzip -mx9 %FBBUILD_EMBFILE% %FBBUILD_EMB_PACK_ROOT%\*.*
::End of EMB_PACK
@echo End of EMB_PACK
@echo.
::---------------
goto :EOF
@ -620,12 +642,13 @@ endlocal
::
::=================================================
if %FBBUILD_ISX_PACK% NEQ 1 goto :EOF
@Echo Now let's compile the InnoSetup scripts
@Echo Now let's compile the InnoSetup scripts
@Echo.
%INNO5_SETUP_PATH%\iscc %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall_%FBBUILD_FILE_ID%.iss
@echo.
::End of ISX_PACK
@echo End of ISX_PACK
@echo.
::---------------
@goto :EOF
@ -743,6 +766,12 @@ popd
@(@call :COPY_XTRA ) || (@echo Error calling COPY_XTRA & @goto :EOF)
@Echo.
if defined WIX (
@Echo Building MSI runtimes
@call :BUILD_CRT_MSI ) || (@echo Error calling BUILD_CRT_MSI & @goto :EOF)
@Echo.
)
@Echo Concatenating header files for ibase.h
@(@call :IBASE_H ) || (@echo Error calling IBASE_H & @goto :EOF)
@Echo.

View File

@ -42,7 +42,8 @@
function CopyFbClientLib: boolean;
function ShowCopyFbClientLibTask: boolean;
function HasWI30: boolean;
function HasNotWI30: boolean;
*)
@ -732,4 +733,24 @@ begin
result := ((not CopyFbClient) and ConfigureFirebird);
end;
function HasWI30: boolean;
//We need at least Windows Installer 3.0 available if we
//are installing the msi bundles for the VC8 CRT libraries.
var
VersionStr: String;
VerInt: array of Integer;
begin
Result := False;
VersionStr := WIVersion;
DecodeVersion( VersionStr, VerInt);
if (VerInt[0] >= 3) then
Result := True;
end;
function HasNotWI30: boolean;
//Used to check if O/S does NOT have minimum version of Windows Installer
begin
result := NOT HasWI30;
end;

View File

@ -36,6 +36,7 @@ Function Prototypes
function CheckWinsock2(): Boolean;
function GetAppPath: String;
function GetSysPath: String;
function WIVersion: string;
function ReplaceLine(Filename, StringToFind, NewLine,CommentType: string): boolean;
procedure DecodeVersion( VerStr: String; var VerInt: array of Integer );
function CompareVersion( ver1, ver2: String ) : Integer;
@ -55,11 +56,56 @@ InnoSetup Help Extract on Windows version strings:
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
5.01.2600 Windows XP
or Windows XP 64-Bit Edition Version 2002 (Itanium)
5.02.3790 Windows Server 2003
or Windows XP x64 Edition (AMD64/EM64T)
or Windows XP 64-Bit Edition Version 2003 (Itanium)
6.0.6000 Windows Vista
*)
(*
Windows Installer versions: (extracted from MSDN)
Release Version Description
-----------------------------------------------
v2.0 2.0.2600.0 Released with Windows XP.
v2.0 2.0.2600.1 Released with Windows 2000 Server SP3.
v2.0 2.0.2600.1183 Released with Windows 2000 Server SP4.
v2.0 2.0.2600.2 Released as a redistributable.
v2.0 2.0.2600.1106 Released with Windows XP SP1.
v2.0 2.0.3790.0 Released with Windows Server 2003.
v3.0 3.0.3790.2180 Released with Windows XP SP2.
Released as a redistributable.
v3.1 3.1.4000.1823 Released as a redistributable.
This version has the same functionality as version 3.1.4000.2435.
v3.1 3.1.4000.1830 Released with Windows Server 2003 SP1 and
Windows XP Professional x64 Edition.
Update this version to version 3.1.4000.2435
to address the issue discussed in KB898628.
v3.1 3.1.4000.2435 Released with a fix to address the issue
discussed in KB898628. This is the latest version
of Windows Installer 3.1.
v4.0 4.0.6000.16386 Released with Windows Vista.
v4.0 4.0.6001.16531 or greater Released with Windows Vista SP1 and
Windows Server 2008.
(NB1 - msi.dll stores the correct version number and is updated
automatically by Windows Update. msiexec.exe will be the original shipped version.
NB2 - Re v3.1 build numbers and KB 898628 - This KB article refers to the
fact that initial releases of WI 3.1 would error and STOP if an attempt
was made to overwrite a system file in the WFP list. Previous behaviour
was to error, log and continue. This behaviour is irrelevant to us because
we don't do anything sophisticated with the msi. OTOH, if we used msi
for all our installation needs this would be a serious problem.
NB3 - Our installer will not run msiexec on systems before XP. However, some early XP and W2K3
systems to not have v3.0 of the Windows Installer.
*)
function IsVista: boolean;
@ -173,6 +219,15 @@ begin
// Result := '"' + Result +'"';
end;
function WIVersion: string;
//Get version of Windows Installer
var
VersionStr: string;
begin
GetVersionNumbersString( GetSysPath + '\msi.dll', VersionStr );
result := VersionStr;
end;
(*Based on InnoSetup KB example at http://www13.brinkster.com/vincenzog/isxart.asp?idart=14)*)
function ReplaceLine(Filename, StringToFind, NewLine,CommentType: string): boolean;

View File

@ -235,9 +235,16 @@ PrivilegesRequired=admin
#if PlatformTarget == "x64"
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
#endif
;This feature is incomplete, as more thought is required.
#ifdef setuplogging
;New with IS 5.2
SetupLogging=yes
#endif
[Languages]
Name: en; MessagesFile: compiler:Default.isl; InfoBeforeFile: {#ScriptsDir}\installation_readme.txt; InfoAfterFile: {#ScriptsDir}\readme.txt;
#ifdef i18n
@ -323,6 +330,13 @@ Name: CopyFbClientAsGds32Task; Description: {cm:CopyFbClientAsGds32Task}; Compon
[Run]
#if msvc_version == 8
Filename: msiexec.exe; Parameters: "/qn /i ""{tmp}\vccrt{#msvc_version}_Win32.msi"" /L*v {tmp}\vccrt{#msvc_version}_Win32.log "; Check: HasWI30; Components: ClientComponent;
#if PlatformTarget == "x64"
Filename: msiexec.exe; Parameters: "/qn /i ""{tmp}\vccrt{#msvc_version}_x64.msi"" /L*v {tmp}\vccrt{#msvc_version}_x64.log "; Check: HasWI30; Components: ClientComponent;
#endif
#endif
;Always register Firebird
Filename: {app}\bin\instreg.exe; Parameters: "install "; StatusMsg: {cm:instreg}; MinVersion: 4.0,4.0; Components: ClientComponent; Flags: runminimized
@ -433,32 +447,67 @@ Source: {#FilesDir}\bin\icuuc30.dll; DestDir: {app}\bin; Components: ServerCompo
Source: {#FilesDir}\bin\icuin30.dll; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion
Source: {#FilesDir}\bin\icudt30.dll; DestDir: {app}\bin; Components: ServerComponent; Flags: sharedfile ignoreversion
; Install MS libs locally if Win2K or later, else place in <sys> 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 {#FilesDir}\system32\
;Rules for installation of MS runtimes
;MSVC6 and MSVC7
; Install locally and in <sys> for all versions.
; 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 {#FilesDir}\system32\
;
;MSVC8
; If Win9n, or a WinNT version without Windows Installer 3 or later then install libraries directly into <sys>
; using normal version info control.
; If host O/S has Windows Installer 3 or later then use msi.
;MSVC9
; More info to come
;
#if msvc_version == 6
Source: {#FilesDir}\bin\msvcrt.dll; DestDir: {app}\bin; Components: ClientComponent;
Source: {#FilesDir}\bin\msvcrt.dll; DestDir: {sys}; Components: ClientComponent; Flags: sharedfile onlyifdoesntexist uninsneveruninstall;
#elif msvc_version >= 7
#endif
#if msvc_version == 7
Source: {#FilesDir}\bin\msvcr{#msvc_version}?.dll; DestDir: {app}\bin; Components: ClientComponent; Flags: sharedfile;
Source: {#FilesDir}\bin\msvcr{#msvc_version}?.dll; DestDir: {sys}; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#FilesDir}\bin\msvcp{#msvc_version}?.dll; DestDir: {app}\bin; Components: ClientComponent; Flags: sharedfile;
Source: {#FilesDir}\bin\msvcr{#msvc_version}?.dll; DestDir: {sys}; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#FilesDir}\bin\msvcp{#msvc_version}?.dll; DestDir: {sys}; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
#endif
#if msvc_version >= 8
;If Host O/S has Windows Installer 3.0 installed then we don't need to do local install of runtime libraries
;In fact, local install is next to useless as the fbintl.dll will still fail to load.
Source: {#FilesDir}\bin\msvcr{#msvc_version}?.dll; DestDir: {app}\bin; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile;
Source: {#FilesDir}\bin\msvcp{#msvc_version}?.dll; DestDir: {app}\bin; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile;
Source: {#FilesDir}\bin\Microsoft.VC80.CRT.manifest; DestDir: {app}\bin; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile;
#if PlatformTarget == "x64"
;If we are installing on x64 we need some 32-bit libraries for compatibility with 32-bit applications
Source: {#WOW64Dir}\bin\msvcr{#msvc_version}?.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile;
Source: {#WOW64Dir}\bin\msvcr{#msvc_version}?.dll; DestDir: {syswow64}; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#WOW64Dir}\bin\msvcp{#msvc_version}?.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile;
Source: {#WOW64Dir}\bin\msvcp{#msvc_version}?.dll; DestDir: {syswow64}; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#WOW64Dir}\bin\msvcr{#msvc_version}?.dll; DestDir: {app}\WOW64; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile;
Source: {#WOW64Dir}\bin\msvcp{#msvc_version}?.dll; DestDir: {app}\WOW64; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile;
Source: {#WOW64Dir}\bin\Microsoft.VC80.CRT.manifest; DestDir: {app}\WOW64; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile;
#endif
#endif
#if msvc_version = 8
Source: {#FilesDir}\bin\Microsoft.VC80.CRT.manifest; DestDir: {app}\bin; Components: ClientComponent; Flags: sharedfile;
#endif /* if msvc_version >= 8 */
#if msvc_version == 8
;Try to install CRT libraries to <sys> via msi, _IF_ msvc_version is 8.
#if PlatformTarget == "x64"
Source: {#WOW64Dir}\bin\Microsoft.VC80.CRT.manifest; DestDir: {syswow64}; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
;MinVersion 0,5.0 means no version of Win9x and at least Win2k if NT O/S
;In addition, O/S must have Windows Installer 3.0.
Source: {#FilesDir}\system32\vccrt8_x64.msi; DestDir: {tmp}; Check: HasWI30; MinVersion: 0,5.0; Components: ClientComponent;
Source: {#WOW64Dir}\system32\vccrt8_Win32.msi; DestDir: {tmp}; Check: HasWI30; MinVersion: 0,5.0; Components: ClientComponent;
#else
Source: {#FilesDir}\system32\vccrt8_Win32.msi; DestDir: {tmp}; Check: HasWI30; MinVersion: 0,5.0; Components: ClientComponent;
#endif
;Otherwise, have a go at copying the files into <sys>.
Source: {#FilesDir}\bin\msvcr{#msvc_version}?.dll; DestDir: {sys}; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#FilesDir}\bin\msvcp{#msvc_version}?.dll; DestDir: {sys}; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#FilesDir}\bin\Microsoft.VC80.CRT.manifest; DestDir: {sys}; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
#if PlatformTarget == "x64"
Source: {#WOW64Dir}\bin\msvcr{#msvc_version}?.dll; DestDir: {syswow64}; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#WOW64Dir}\bin\msvcp{#msvc_version}?.dll; DestDir: {syswow64}; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
Source: {#WOW64Dir}\bin\Microsoft.VC80.CRT.manifest; DestDir: {syswow64}; Check: HasNotWI30; Components: ClientComponent; Flags: sharedfile uninsneveruninstall;
#endif
#endif /* if msvc_version == 8 */
;Docs
Source: {#ScriptsDir}\installation_scripted.txt; DestDir: {app}\doc; Components: DevAdminComponent; Flags: skipifsourcedoesntexist ignoreversion
Source: {#ScriptsDir}\installation_scripted.txt; DestDir: {tmp}; Flags: DontCopy;
@ -483,7 +532,7 @@ Source: {#FilesDir}\misc\upgrade\metadata\*.*; DestDir: {app}\misc\upgrade\metad
;Note - Win9x requires 8.3 filenames for the uninsrestartdelete option to work
Source: {#FilesDir}\system32\Firebird2Control.cpl; DestDir: {sys}; Components: ServerComponent\SuperServerComponent; MinVersion: 0,4.0; Flags: sharedfile ignoreversion promptifolder restartreplace uninsrestartdelete; Check: InstallCPLApplet
Source: {#FilesDir}\system32\Firebird2Control.cpl; DestDir: {sys}; Destname: FIREBI~1.CPL; Components: ServerComponent\SuperServerComponent; MinVersion: 4.0,0; Flags: sharedfile ignoreversion promptifolder restartreplace uninsrestartdelete; Check: InstallCPLApplet
#endif
#endif /* files */
#ifdef examples
Source: {#FilesDir}\examples\*.*; DestDir: {app}\examples; Components: DevAdminComponent; Flags: ignoreversion;
@ -501,6 +550,9 @@ Source: {#FilesDir}\bin\fbclient.pdb; DestDir: {app}\bin; Components: ClientComp
Source: {#FilesDir}\bin\fb_inet_server.pdb; DestDir: {app}\bin; Components: ServerComponent\ClassicServerComponent;
Source: {#FilesDir}\bin\fbserver.pdb; DestDir: {app}\bin; Components: ServerComponent\SuperServerComponent;
;Source: {#FilesDir}\bin\fbembed.pdb; DestDir: {app}\bin; Components: ClientComponent;
#if PlatformTarget == "x64"
Source: {#WOW64Dir}\bin\fbclient.pdb; DestDir: {app}\WOW64; Components: ClientComponent;
#endif
#endif
[UninstallRun]
@ -556,6 +608,9 @@ Var
// user config files - firebird.conf, firebird.log,
// aliases.conf and the security database.
#ifdef setuplogging
OkToCopyLog : Boolean; // Set when installation is complete.
#endif
#include "FirebirdInstallSupportFunctions.inc"
@ -714,16 +769,16 @@ begin
end;
if pos('FORCE',Uppercase(CommandLine))>0 then
if pos('FORCE',Uppercase(CommandLine)) > 0 then
ForceInstall:=True;
if pos('NOCPL', Uppercase(CommandLine))>0 then
if pos('NOCPL', Uppercase(CommandLine)) > 0 then
NoCPL := True;
if pos('NOGDS32', Uppercase(CommandLine))>0 then
if pos('NOGDS32', Uppercase(CommandLine)) > 0 then
NoLegacyClient := True;
if pos('COPYFBCLIENT', Uppercase(CommandLine))>0 then
if pos('COPYFBCLIENT', Uppercase(CommandLine)) > 0 then
CopyFbClient := True;
//By default we want to install and confugure,
@ -762,6 +817,14 @@ begin
if MsgBox(ExpandConstant('{cm:Winsock2Web1}')+#13#13+ExpandConstant('{cm:Winsock2Web2}'), mbInformation, MB_YESNO) = idYes then
// User wants to visit the web page
ShellExec('open', sMSWinsock2Update, '', '', SW_SHOWNORMAL, ewNoWait, ErrCode);
#ifdef setuplogging
if OkToCopyLog then
FileCopy (ExpandConstant ('{log}'), ExpandConstant ('{app}\InstallationLogFile.log'), FALSE);
RestartReplace (ExpandConstant ('{log}'), '');
#endif /* setuplogging */
end;
//This function tries to find an existing install of Firebird 1.5
@ -987,6 +1050,10 @@ begin
DeleteFile(GetAppPath+'\doc\'+ReadMeFileStr);
end;
#ifdef setuplogging
OkToCopyLog := True;
#endif
end;
end;
end;

View File

@ -19,6 +19,7 @@ Contents
--------
o Before installation
o Problems with installation of MS VC runtime libraries
o Known installation problems
o Uninstallation
o Other Notes
@ -34,8 +35,25 @@ this package. It is especially important to verify that
fbclient.dll and gds32.dll are removed from <system32>.
Known installation problems
---------------------------
Problems with installation of MS VC runtime libraries
-----------------------------------------------------
Much work has been done to ensure that the MS Visual
C runtime libraries are correctly installed by the
binary installer. However, in case of problems it may
be necessary to deploy the official vcredist.exe. The
correct versions for this build of Firebird can be
found here:
http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
and x64 here:
http://www.microsoft.com/downloads/details.aspx?familyid=90548130-4468-4BBC-9673-D6ACABD5D13B&displaylang=en
Other Known installation problems
---------------------------------
o It is only possible to use the binary installer
to install the default instance of Firebird 2.1. If
@ -59,18 +77,11 @@ o There are known areas of overlap between the
installed they will both point to the same default
instance.
o It is possible to deploy the client library
(fbclient or gds32) to the <system32> directory.
However, the necessary microsoft runtime libraries
will be missing. To resolve this it is necessary to
manually install vcredist.exe. Different versions are
available for x86 here:
http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
and x64 here:
http://www.microsoft.com/downloads/details.aspx?familyid=90548130-4468-4BBC-9673-D6ACABD5D13B&displaylang=en
o When installing under Vista be sure to install as an
administrator. ie, if using the binary installer
right click and choose 'Run as administrator'.
Otherwise the installer will be unable to start the
Firebird service at the end of installation.
Uninstallation
@ -109,6 +120,11 @@ o A new feature of the uninstaller is an option to
the shared file count of each of the above files. If
possible it will delete them.
o Uninstallation will not remove the MS VC runtime
libraries from the system directory. These can be
removed manually via the control panel, but this
should not be required under normal circumstances.
Other Notes
-----------