Skip to content

Commit 0174984

Browse files
committed
Forward port changes from FB5
1 parent 156fc59 commit 0174984

File tree

2 files changed

+82
-54
lines changed

2 files changed

+82
-54
lines changed

builds/install/arch-specific/win32/test_installer/fbit.ps1

Lines changed: 77 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ fbit {PARAM [...]]
6363
If -password is not passed on the command-line and
6464
ISC_PASSWORD is set then ISC_PASSWORD will be used.
6565
-legacy_auth EnableLegacyClientAuth Adds support for legacy authentication
66+
-msilogdir /MSILOGDIR="path to store logs" Generate msiexec logs to aid debugging of ms runtime
67+
installation.
68+
-nomsvcrt /NOMSVCRT Do not install the MS VCRT runtimes
69+
6670
6771
Installation Tasks
6872
==================
@@ -186,11 +190,14 @@ param(
186190
[string]$components = "",
187191
[switch]$copygdslib,
188192
[switch]$dev_install,
193+
[switch]$legacy_auth,
194+
[string]$msilogdir = "",
189195
[switch]$noarchive,
190196
[switch]$noautostart,
191197
[switch]$nocancel,
192198
[switch]$nocopyfblib,
193199
[switch]$nomsg,
200+
[switch]$nomsvcrt,
194201
[string]$password = "masterkey",
195202
[switch]$server_install,
196203
[switch]$silent,
@@ -307,7 +314,8 @@ function LoadConfig( [string] $_conffile ) {
307314
{ $_ -eq "0" } {
308315
Write-Debug "Setting $local:akey to false"
309316
Set-Variable -Scope Global -Name $local:akey -Value $false
310-
Set-Variable -Scope Script -Name $local:akey -Value $false }
317+
Set-Variable -Scope Script -Name $local:akey -Value $false
318+
}
311319
{ $_ -eq $null } {
312320
Write-Debug "Setting $local:akey to true"
313321
Set-Variable -Scope Global -Name $local:akey -Value $true
@@ -324,9 +332,9 @@ function LoadConfig( [string] $_conffile ) {
324332
}
325333
}
326334
}
327-
# Set-PSDebug -Off
328-
# Get-ChildItem Variable:
329-
# Pause "In $($MyInvocation.MyCommand.Name) called from line $($MyInvocation.ScriptLineNumber)"
335+
# Set-PSDebug -Off
336+
# Get-ChildItem Variable:
337+
# Pause "In $($MyInvocation.MyCommand.Name) called from line $($MyInvocation.ScriptLineNumber)"
330338
Write-Debug "Leaving function $($MyInvocation.MyCommand.Name)"
331339
}
332340

@@ -339,31 +347,31 @@ function print_vars( [string]$_action ) {
339347
Get-ChildItem Variable:
340348
Pause "In $($MyInvocation.MyCommand.Name) called from line $($MyInvocation.ScriptLineNumber)"
341349
}
342-
if ( $script:IsVerbose ) {
343-
spacer > $local:varfile
344-
if ( check_file_exists "fb_build_vars_${env:PROCESSOR_ARCHITECTURE}.txt" ) {
345-
spacer "Firebird Build Environment" >> $local:varfile
346-
Get-Content fb_build_vars_${env:PROCESSOR_ARCHITECTURE}.txt >> $local:varfile
347-
spacer "Firebird Build Environment END" >> $local:varfile
348-
spacer >> $local:varfile
349-
}
350-
spacer 'Global Vars' >> $local:varfile
351-
Get-Variable -Scope global >> $local:varfile
352-
spacer 'Global Vars END' >> $local:varfile
353-
spacer >> $local:varfile
354-
spacer 'Env Vars' >> $local:varfile
355-
env | grep '^FB' >> $local:varfile
356-
env | grep '^ISC' >> $local:varfile
357-
spacer 'Env Vars END' >> $local:varfile
358-
spacer 'Script Vars' >> $local:varfile
359-
Get-Variable -Scope script | Format-Table -AutoSize -Wrap >> $local:varfile
360-
spacer 'Script Vars END' >> $local:varfile
361-
spacer >> $local:varfile
362-
spacer 'Local Vars' >> $local:varfile
363-
Get-Variable -Scope local >> $local:varfile
364-
spacer 'Local Vars END' >> $local:varfile
350+
# if ( $script:IsVerbose ) {
351+
spacer > $local:varfile
352+
if ( check_file_exists "fb_build_vars_${env:PROCESSOR_ARCHITECTURE}.txt" ) {
353+
spacer "Firebird Build Environment" >> $local:varfile
354+
Get-Content fb_build_vars_${env:PROCESSOR_ARCHITECTURE}.txt >> $local:varfile
355+
spacer "Firebird Build Environment END" >> $local:varfile
365356
spacer >> $local:varfile
366357
}
358+
spacer 'Global Vars' >> $local:varfile
359+
Get-Variable -Scope global >> $local:varfile
360+
spacer 'Global Vars END' >> $local:varfile
361+
spacer >> $local:varfile
362+
spacer 'Env Vars' >> $local:varfile
363+
env | grep '^FB' >> $local:varfile
364+
env | grep '^ISC' >> $local:varfile
365+
spacer 'Env Vars END' >> $local:varfile
366+
spacer 'Script Vars' >> $local:varfile
367+
Get-Variable -Scope script | Format-Table -AutoSize -Wrap >> $local:varfile
368+
spacer 'Script Vars END' >> $local:varfile
369+
spacer >> $local:varfile
370+
spacer 'Local Vars' >> $local:varfile
371+
Get-Variable -Scope local >> $local:varfile
372+
spacer 'Local Vars END' >> $local:varfile
373+
spacer >> $local:varfile
374+
# }
367375
Write-Debug "Leaving $($MyInvocation.MyCommand.Name)"
368376

369377
}
@@ -386,7 +394,7 @@ function check_params() {
386394
$script:IsVerbose = $script:MyInvocation.BoundParameters['Verbose'].IsPresent
387395
}
388396

389-
if ( $(Test-Path variable:$script:MyInvocation.BoundParameters['Debug'] ) ){
397+
if ( $(Test-Path variable:$script:MyInvocation.BoundParameters['Debug'] ) ) {
390398
$script:IsDebug = $script:MyInvocation.BoundParameters['Debug'].IsPresent
391399
}
392400

@@ -617,10 +625,10 @@ function check_service_installed( [string]$_servicename ) {
617625
$local:ActualServiceName = Get-Service -ErrorAction ignore -Name $local:ExpectedServiceName | Select-Object -ExpandProperty Name
618626
if (check_result $local:ExpectedServiceName $local:ActualServiceName $true ) {
619627
$script:fgcol = ( $script:action -eq "check_install" ) ? $script:fggreen : $script:fgred
620-
Write-Host -ForegroundColor $script:fgcol "${TAB}$local:ExpectedServiceName is installed. "
628+
Write-Host -ForegroundColor $script:fgcol "${TAB}$local:ExpectedServiceName is installed. "
621629
} else {
622630
$script:fgcol = ( $script:action -eq "check_uninstall" ) ? $script:fggreen : $script:fgred
623-
Write-Host -ForegroundColor $script:fgcol "${TAB}$local:ExpectedServiceName is NOT installed. "
631+
Write-Host -ForegroundColor $script:fgcol "${TAB}$local:ExpectedServiceName is NOT installed. "
624632
}
625633
}
626634

@@ -632,7 +640,7 @@ function load_fb_build_env() {
632640
$local:fbbuild_vars_file = Get-Content "fb_build_vars_${env:PROCESSOR_ARCHITECTURE}.txt"
633641

634642
$script:fbbuild_vars = @{}
635-
# $local:fbbuild_vars_file | Sort-Object -Property key | ForEach-Object {
643+
# $local:fbbuild_vars_file | Sort-Object -Property key | ForEach-Object {
636644
$local:fbbuild_vars_file | ForEach-Object {
637645
$s = $_ -split "="
638646
$s[1] = $s[1].Trim()
@@ -647,7 +655,7 @@ function load_fb_build_env() {
647655
# Normally this should not happen if we have just built firebird
648656
if ( ! $script:fbbuild_vars.ContainsKey('FB_MAJOR_VER') ) {
649657
# Try to locate build_no.h
650-
$local:fb_root_path= $script:fbbuild_vars.'FB_ROOT_PATH'
658+
$local:fb_root_path = $script:fbbuild_vars.'FB_ROOT_PATH'
651659
if ( Test-Path "${local:fb_root_path}\src\jrd\build_no.h" -PathType Leaf ) {
652660

653661
foreach ($aline in $(Get-Content ${local:fb_root_path}\src\jrd\build_no.h | grep "#define FB_")) {
@@ -688,15 +696,15 @@ function check_environment() {
688696
# If passed via command line
689697
if ( $script:fbinst_exec -ne "" ) {
690698
Write-Debug "Determine build env from $script:fbinst_exec"
691-
# Set-PSDebug -Trace 2
699+
# Set-PSDebug -Trace 2
692700
$path_file = @{}
693701
$path_file = $script:fbinst_exec -split "\\", -2
694702
$path_file = $path_file[1] -split ".exe" , 2
695703
$script:FirebirdInstallVer = $path_file[0]
696704
$_astr = $script:FirebirdInstallVer -split "\."
697705
$_astr = $_astr[0] -split "-"
698706
$script:fbmajver = $_astr[1]
699-
# Set-PSDebug -Trace 0
707+
# Set-PSDebug -Trace 0
700708
} else {
701709
Write-Debug "Determine build env dynamically"
702710
load_fb_build_env
@@ -722,7 +730,7 @@ function check_environment() {
722730
Pause "In $($MyInvocation.MyCommand.Name) called from line $($MyInvocation.ScriptLineNumber)"
723731
}
724732

725-
# Set-PSDebug -Trace 2
733+
# Set-PSDebug -Trace 2
726734
$script:fbinstalllogdir = "$env:userprofile\fbit-tests\logs"
727735
$script:fbinstallcopydir = "$env:userprofile\fbit-tests\install_archive"
728736

@@ -774,6 +782,11 @@ function check_innosetup_params() {
774782
$script:inno_verysilent = " /VERYSILENT "
775783
$script:inno_sp = " /SP- "
776784
$script:inno_nomsg = " /SUPPRESSMSGBOXES "
785+
} else {
786+
# FIXME declare correctly
787+
$script:inno_verysilent = ""
788+
$script:inno_sp = ""
789+
$script:inno_nomsg = ""
777790
}
778791

779792

@@ -866,6 +879,19 @@ function check_innosetup_params() {
866879
}
867880
}
868881

882+
if ( $script:msilogdir -ne "" ) {
883+
$script:inno_msilogdir = " /MSILOGDIR=`"$script:msilogdir`" "
884+
} else {
885+
$script:inno_msilogdir = ""
886+
}
887+
888+
if ( $($script:nomsvcrt) ) {
889+
$script:inno_nomsvcrt = " /NOMSVCRT "
890+
} else {
891+
$script:inno_nomsvcrt = ""
892+
}
893+
894+
869895
} # End check innosetup params for install
870896

871897
spacer
@@ -926,8 +952,8 @@ function build_inno_cmd() {
926952
if ( $script:install ) {
927953
# Setting PASSWORD is only relevant for a server install
928954
if ( $script:password -ne "masterkey" ) {
929-
$script:inno_params_from_cmdline += " $script:inno_sysdbapassword "
930-
$script:inno_installtype = "CustomInstall"
955+
$script:inno_params_from_cmdline += " $script:inno_sysdbapassword "
956+
$script:inno_installtype = "CustomInstall"
931957
}
932958

933959
if ( $script:inno_installtype -eq "CustomInstall" ) {
@@ -940,11 +966,16 @@ function build_inno_cmd() {
940966
$script:inno_components = "ServerComponent,DevAdminComponent,ClientComponent"
941967
}
942968

969+
$script:inno_params_from_cmdline += " $script:inno_msilogdir "
970+
971+
$script:inno_params_from_cmdline += " $script:inno_nomsvcrt "
972+
943973
if ( $script:TASK_LIST ) {
944974
$script:full_cmdline = " /TYPE=`"$script:inno_installtype`" /TASKS=`"$script:task_list`" /COMPONENTS=`"$script:inno_components`" $script:inno_params_from_cmdline "
945975
} else {
946976
$script:full_cmdline = "/TYPE=`"$script:inno_installtype`" /COMPONENTS=`"$script:inno_components`" $script:inno_params_from_cmdline "
947977
}
978+
948979
}
949980

950981
# Always add on the boiler plate log and inf output to the command
@@ -965,7 +996,7 @@ function dry_run( [string]$_action, [string]$_exec ) {
965996
function run_check_install() {
966997

967998

968-
if ( $script:action | Select-String -Pattern "un" -SimpleMatch -Quiet ) {
999+
if ( $script:action | Select-String -Pattern "un" -SimpleMatch -Quiet ) {
9691000
$script:action = "check_uninstall"
9701001
Write-Output "Checking uninstallation..."
9711002
} else {
@@ -989,8 +1020,8 @@ function run_installer() {
9891020
$local:retval = 0
9901021
}
9911022

992-
# We use BEGIN..PROCESS..END here so that we can mask the output of copyinstall and
993-
# allow the function to return an integer instean of an object.
1023+
# We use BEGIN..PROCESS..END here so that we can mask the output of copyinstall and
1024+
# allow the function to return an integer instead of an object.
9941025
process {
9951026
build_inno_cmd
9961027
print_vars "$script:action"
@@ -1100,8 +1131,8 @@ function run_cleanup() {
11001131
Write-Verbose "Clean up listing of Shared DLLs in registry"
11011132
$RegKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs"
11021133
foreach ( $avalue in "C:\Program\*.*", "${script:firebirdrootdir}\${script:firebird_base_ver}\*.*", `
1103-
"*\fbclient.dll", "*\gds32.dll", "*GDS32.DLL" ) {
1104-
Remove-ItemProperty HKLM:$RegKey -Name $avalue -Confirm
1134+
"*\fbclient.dll", "*\gds32.dll", "*GDS32.DLL" ) {
1135+
Remove-ItemProperty HKLM:$RegKey -Name $avalue -Confirm
11051136
}
11061137
}
11071138
Write-Verbose "Completed cleanup of Firebird installation"
@@ -1149,9 +1180,9 @@ function iss_error( [Int32]$_err_code = 0 ) {
11491180
}
11501181

11511182
function main() {
1152-
begin{
1153-
# $script:DebugPreference = 'Continue'
1154-
# $script:VerbosePreference = 'Continue'
1183+
begin {
1184+
# $script:DebugPreference = 'Continue'
1185+
# $script:VerbosePreference = 'Continue'
11551186

11561187
Set-StrictMode -Version 3.0
11571188
}
@@ -1186,7 +1217,7 @@ function main() {
11861217
}
11871218
}
11881219

1189-
end{
1220+
end {
11901221
spacer " Finished "
11911222

11921223
# this attempt to 'reset' the prompt fails :-(

builds/win32/run_all.bat

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set FBBUILD_BUILDTYPE=release
99
set FBBUILD_INCLUDE_PDB=
1010
set FBBUILD_MAKE_KITS_ONLY=
1111
set FBBUILD_BUILD_ONLY=0
12+
set FBBUILD_KITS=ISX ZIP
1213
set FBBUILD_TEST_ONLY=
1314
set FB2_SNAPSHOT=
1415

@@ -61,13 +62,13 @@ if "%FBBUILD_BUILD_ONLY%"=="1" goto :END
6162
:MAKE_KITS
6263
:: Package everything up
6364
pushd ..\install\arch-specific\win32
64-
call BuildExecutableInstall ISX ZIP EMB %FBBUILD_BUILDTYPE%
65+
call BuildExecutableInstall %FBBUILD_KITS% %FBBUILD_BUILDTYPE%
6566
if "%ERRLEV%"=="1" (
6667
@echo Oops - some sort of error during packaging & popd & goto :END
6768
)
6869
if defined FBBUILD_INCLUDE_PDB (
6970
set /A FBBUILD_PACKAGE_NUMBER-=1
70-
call BuildExecutableInstall ISX ZIP EMB %FBBUILD_BUILDTYPE% PDB
71+
call BuildExecutableInstall %FBBUILD_KITS% %FBBUILD_BUILDTYPE% PDB
7172
)
7273
popd
7374

@@ -112,12 +113,8 @@ goto :END
112113
:: Show variables
113114
@call setenvvar.bat %*
114115
if "%ERRLEV%"=="1" goto :END
115-
echo.
116-
set FB
117-
set MS
118-
set VC
119-
set VS
120-
echo.
116+
set > %TEMP%\fb_build_vars_%PROCESSOR_ARCHITECTURE%.txt
117+
type %TEMP%\fb_build_vars_%PROCESSOR_ARCHITECTURE%.txt
121118
goto :END
122119
::---------
123120

0 commit comments

Comments
 (0)