Skip to content

Commit 70bfc50

Browse files
committed
Fix #8407 InnoSetup based installer deletes msiexec log of runtime libraries install
Fix #8408 Add option to disable install of MS VCRT runtime libraries via a scripted install
1 parent 4fa00f1 commit 70bfc50

File tree

4 files changed

+165
-58
lines changed

4 files changed

+165
-58
lines changed

builds/install/arch-specific/win32/FirebirdInstall.iss

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
#define debug_str=""
276276
#endif
277277

278+
#define InstallTimeStamp GetDateTimeString('yyyymmdd-hhnnss','','')
278279

279280
[Setup]
280281
AppName={#MyAppName}
@@ -398,9 +399,9 @@ Name: CopyFbClientAsGds32Task; Description: {cm:CopyFbClientAsGds32Task}; Compon
398399
[Run]
399400
; due to the changes required to support MSVC15 support for earlier versions is now broken.
400401
#if Int(msvc_runtime_major_version,14) >= 14
401-
Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_Win32.msi"" /L*v ""{tmp}\vccrt{#msvc_runtime_library_version}_Win32.log"" "; StatusMsg: "Installing MSVC 32-bit runtime libraries to system directory"; Check: HasWI30; Components: ClientComponent;
402+
Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_Win32.msi"" /l*v ""{code:MsiexecLogDir}\vccrt{#msvc_runtime_library_version}_Win32-{#InstallTimeStamp}.log"" "; StatusMsg: "Installing MSVC 32-bit runtime libraries to system directory"; Check: InstallVCRT; Components: ClientComponent;
402403
#if PlatformTarget == "x64"
403-
Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_x64.msi"" /L*v ""{tmp}\vccrt{#msvc_runtime_library_version}_x64.log"" "; StatusMsg: "Installing MSVC 64-bit runtime libraries to system directory"; Check: HasWI30; Components: ClientComponent;
404+
Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_x64.msi"" /l*v ""{code:MsiexecLogDir}\vccrt{#msvc_runtime_library_version}_x64-{#InstallTimeStamp}.log"" "; StatusMsg: "Installing MSVC 64-bit runtime libraries to system directory"; Check: InstallVCRT; Components: ClientComponent;
404405
#endif
405406
#endif
406407

@@ -655,6 +656,10 @@ Var
655656
656657
init_secdb: integer; // Is set to UNDEFINED by default in InitializeSetup
657658
659+
msilogdir: String; // Path to store logs from msiexec
660+
661+
novcrt: Boolean; // Do not install the VC runtime libs
662+
658663
#ifdef setuplogging
659664
// Not yet implemented - leave log in %TEMP%
660665
// OkToCopyLog : Boolean; // Set when installation is complete.
@@ -715,13 +720,17 @@ begin
715720
if pos('FORCE',Uppercase(CommandLine)) > 0 then
716721
ForceInstall:=True;
717722
723+
if pos('NOMSVCRT', Uppercase(CommandLine) ) > 0 then
724+
novcrt := true;
718725
719-
cmdParams := TStringList.create;
720-
for i:=0 to ParamCount do begin
721-
cmdParams.add(ParamStr(i));
722-
if pos('SYSDBAPASSWORD', Uppercase(ParamStr(i)) ) > 0 then
723-
SYSDBAPassword := Copy(ParamStr(i),Length('/SYSDBAPASSWORD=')+1,Length(ParamStr(i))-Length('/SYSDBAPASSWORD=') );
724-
end;
726+
cmdParams := TStringList.create;
727+
for i:=0 to ParamCount do begin
728+
cmdParams.add(ParamStr(i));
729+
if pos('SYSDBAPASSWORD', Uppercase(ParamStr(i)) ) > 0 then
730+
SYSDBAPassword := SplitKeyValue( ParamStr(i), false );
731+
if pos('MSILOGDIR', Uppercase( ParamStr(i) ) ) > 0 then
732+
msilogdir := SplitKeyValue( ParamStr(i), false );
733+
end;
725734
#ifdef iss_debug
726735
ShowDebugDlg(cmdParams.text,'');
727736
#endif
@@ -1261,6 +1270,26 @@ begin
12611270
end;
12621271
end;
12631272
1273+
function MsiexecLogDir( nullstr: String ): String;
1274+
begin
1275+
if msilogdir = '' then
1276+
msilogdir := ExpandConstant('{tmp}');
1277+
Result := msilogdir;
1278+
end;
1279+
1280+
function InstallVCRT: boolean;
1281+
begin
1282+
if novcrt then begin
1283+
Result := false;
1284+
exit;
1285+
end;
1286+
if HasNotWI30 then
1287+
Result := false
1288+
else
1289+
Result := true;
1290+
1291+
end;
1292+
12641293
begin
12651294
end.
12661295

builds/install/arch-specific/win32/FirebirdInstallSupportFunctions.inc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Function Prototypes
5353
function GetInstalledVersion(BinaryFile: String): Array of Integer;
5454
function ConvertIBVerStrToFbVerStr( VerStr: String) : String;
5555
function GetRegistryEntry(RegKey, RegEntry: string): String;
56+
function SplitKeyValue( AString: String; theKey: Boolean): String;
5657
5758
*)
5859

@@ -477,4 +478,26 @@ begin
477478
RegQueryStringValue(RootKey, RegKey, RegEntry, Result);
478479
end;
479480

481+
482+
// Split a key value pair in two and return the value by default
483+
function SplitKeyValue( AString: String; theKey: Boolean): String;
484+
var
485+
apos: integer;
486+
akey: String;
487+
avalue: String;
488+
begin
489+
Result := '';
490+
apos := pos( '=', AString );
491+
if apos <> 0 then begin
492+
akey := Copy( Astring, 1, apos - 1 );
493+
aValue := Copy ( AString, apos + 1, length (Astring) - apos );
494+
end;
495+
if theKey then
496+
Result := aKey
497+
else
498+
Result := aValue;
499+
end;
500+
501+
502+
480503
// kate: replace-tabs on; indent-width 2; tab-width 2; replace-tabs-save on; syntax Pascal;

builds/install/arch-specific/win32/installation_scripted.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ HELP
4141
/MERGETASKS="comma separated list of task names"
4242
/SYSDBAPASSWORD="masterkey"
4343
/FORCE
44+
/MSILOGDIR="Path to log output from installation of VC runtimes."
45+
/NOMSVCRT
4446

4547
Setup parameters specific to the Firebird Uninstaller
4648
/CLEAN
@@ -72,7 +74,7 @@ HELP
7274

7375
would be required for a client only install.
7476

75-
NOTE - If a full server install is required there is no need to
77+
NOTE - If a full server install is required there is no need to
7678
specify /COMPONENTS. All three are chosen by default.
7779

7880

@@ -137,6 +139,29 @@ HELP
137139
Its your choice.
138140

139141

142+
/MSILOGDIR="Path to log output from installation of the redistributable
143+
VC runtime libraries."
144+
145+
This is to help debug problems arising from running the vc runtime
146+
installer. There is no need to set this unless installation of the
147+
runtimes causes the installation of Firebird to trigger a reboot of
148+
Windows. The log may help debug the problem.
149+
150+
151+
/NOMSVCRT
152+
153+
Set this to disable installation of the redistributable MS VCRT
154+
runtime libraries that are included in the Firebird binary installer.
155+
Firebird comes with a stripped down set of the redistributable runtime
156+
libraries. If you wish to deploy the libraries via another means then
157+
you may use this switch to exclude installation of the MSI runtime
158+
libraries that are provided by the Firebird project.
159+
160+
In general use of this switch is not recommended unless you have
161+
problems with installation of the runtimes requiring a reboot of
162+
Windows. Excluding their installation may prevent Firebird from
163+
running if the required libraries are not available.
164+
140165

141166
Parameters specific to Firebird uninstalls
142167
------------------------------------------

0 commit comments

Comments
 (0)