Skip to content

Commit e2ee6af

Browse files
committed
Front port misc changes to installer packaging from FB5
1 parent a7d10a4 commit e2ee6af

9 files changed

+99
-66
lines changed

builds/install/arch-specific/win32/BuildExecutableInstall.bat

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if not defined FB2_SNAPSHOT (set FB2_SNAPSHOT=0)
5454

5555
:: Are we doing a snapshot build? If so we always do less work.
5656
if "%FB2_SNAPSHOT%"=="1" (
57-
(set FBBUILD_ISX_PACK=0)
57+
( set FBBUILD_ISX_PACK=0 )
5858
)
5959

6060

@@ -69,14 +69,14 @@ if "%FB2_SNAPSHOT%"=="1" (
6969
:: let's bail out now.
7070

7171
@echo o Checking for sed...
72-
(cmd /c "sed.exe --version 2>&1 > nul ") || ( call :ERROR Could not locate sed && @goto :EOF )
72+
@(cmd /c "sed.exe --version 2>&1 > nul ") || ( call :ERROR Could not locate sed & goto :EOF )
7373

7474
@echo o Checking for unix2dos...
75-
(cmd /c "unix2dos.exe --quiet --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos && @goto :EOF )
75+
@(cmd /c "unix2dos.exe --quiet --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos & goto :EOF )
7676

77-
@for /f "usebackq tokens=*" %%c in (`where /f md5sum 2^>nul`) do set MD5_COMMAND=%%c
78-
if defined MD5_COMMAND (
79-
@echo o POSIX md5sum utility found at %MD5_COMMAND%
77+
@for /f "usebackq tokens=*" %%c in ( `where /f md5sum 2^>nul` ) do set MD5_COMMAND=%%c
78+
@if defined MD5_COMMAND (
79+
echo o POSIX md5sum utility found at %MD5_COMMAND%
8080
)
8181

8282
@if %FBBUILD_ZIP_PACK% EQU 1 (
@@ -101,8 +101,8 @@ if defined MD5_COMMAND (
101101
for /f "usebackq tokens=*" %%c in ( `where /f iscc 2^>nul` ) do set ISCC_COMMAND=%%c
102102
)
103103
@if not defined ISCC_COMMAND (
104-
@echo Required Inno Setup compiler not found
105-
@exit /b 1
104+
echo Required Inno Setup compiler not found
105+
exit /b 1
106106
)
107107
@echo o Inno Setup found as %ISCC_COMMAND%.
108108

@@ -114,17 +114,17 @@ if defined MD5_COMMAND (
114114
echo WiX is needed to build the MSI kits of the CRT runtimes.
115115
echo.
116116
) else (
117-
echo o WiX found at "%WIX%".
117+
echo o WiX found at "%WIX%".
118118
)
119119

120120
@if not defined FB_EXTERNAL_DOCS (
121-
echo.
122-
echo The FB_EXTERNAL_DOCS environment var is not defined
123-
echo It should point to the directory containing the relevant release notes
124-
echo in adobe pdf format.
125-
echo.
121+
echo.
122+
echo The FB_EXTERNAL_DOCS environment var is not defined
123+
echo It should point to the directory containing the relevant release notes
124+
echo in adobe pdf format.
125+
echo.
126126
) else (
127-
echo o Package will include documentation from "%FB_EXTERNAL_DOCS%".
127+
echo o Package will include documentation from "%FB_EXTERNAL_DOCS%".
128128
)
129129

130130

@@ -192,7 +192,7 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
192192
%SED_COMMAND% %%f > %FB_GEN_DIR%\readmes\%%f
193193
)
194194
@for %%d in (ba cz de es fr hu it pl pt ru si ) do (
195-
if not exist %FB_GEN_DIR%\readmes\%%d ( @mkdir %FB_GEN_DIR%\readmes\%%d )
195+
if not exist %FB_GEN_DIR%\readmes\%%d ( mkdir %FB_GEN_DIR%\readmes\%%d )
196196
for %%f in ( %%d\*.txt ) do (
197197
echo Processing version strings in %%f
198198
%SED_COMMAND% %%f > %FB_GEN_DIR%\readmes\%%f
@@ -201,6 +201,9 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
201201

202202
@endlocal
203203

204+
:: Dump env vars to file for later testing.
205+
@set > %FB_ROOT_PATH%\builds\install\arch-specific\win32\test_installer\fb_build_vars_%PROCESSOR_ARCHITECTURE%.txt
206+
204207
::End of SET_VERSION
205208
::----------------
206209
@goto :EOF
@@ -232,11 +235,13 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
232235
)
233236
)
234237

235-
@where /Q implib.exe
236-
@if not ERRORLEVEL 1 (
237-
if "%VSCMD_ARG_TGT_ARCH%"=="x86" (
238-
echo Generating fbclient_bor.lib
238+
@if "%VSCMD_ARG_TGT_ARCH%"=="x86" (
239+
echo Generating fbclient_bor.lib
240+
where /Q implib.exe
241+
if not ERRORLEVEL 1 (
239242
implib %FB_OUTPUT_DIR%\lib\fbclient_bor.lib %FB_OUTPUT_DIR%\fbclient.dll > nul
243+
) else (
244+
call :ERROR implib not found & goto :EOF
240245
)
241246
)
242247

@@ -289,7 +294,7 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
289294
@mkdir %FB_OUTPUT_DIR%\doc\sql.extensions 2>nul
290295
@if ERRORLEVEL 2 ( ( call :ERROR MKDIR for doc\sql.extensions dir failed) & ( goto :EOF ) )
291296
@copy %FB_ROOT_PATH%\doc\sql.extensions\*.* %FB_OUTPUT_DIR%\doc\sql.extensions\ > nul
292-
@if ERRORLEVEL 1 ( ( call :ERROR Copying doc\sql.extensions failed ) & ( goto :EOF ) )
297+
@if ERRORLEVEL 1 ( ( call :ERROR Copying doc\sql.extensions failed ) & ( goto :EOF ) )
293298

294299
:: External docs aren't necessary for a snapshot build, so we don't throw
295300
:: an error if FB_EXTERNAL_DOCS is not defined. On the other hand,
@@ -300,15 +305,17 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
300305
echo ... %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v
301306
copy /Y %FB_EXTERNAL_DOCS%\%%v %FB_OUTPUT_DIR%\doc\%%v > nul
302307
if ERRORLEVEL 1 (
303-
call :ERROR Copying %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v FAILED. & @goto :EOF
308+
call :ERROR Copying %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v FAILED. & goto :EOF
304309
)
305310
)
306311

307312
echo Copying optional pdf docs...
308313
for %%v in ( firebird-%FB_MAJOR_VER%-quickstartguide.pdf ) do (
309314
echo ... %%v
310315
copy /Y %FB_EXTERNAL_DOCS%\%%v %FB_OUTPUT_DIR%\doc\%%v > nul
311-
if ERRORLEVEL 1 ( call :WARNING Copying %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v FAILED. & @goto :EOF )
316+
if ERRORLEVEL 1 (
317+
call :WARNING Copying %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v FAILED. & goto :EOF
318+
)
312319
)
313320

314321
echo Finished copying pdf docs...
@@ -333,7 +340,7 @@ for %%v in (IPLicense.txt IDPLicense.txt ) do (
333340

334341
:: Walk through all docs and transform any that are not .txt, .pdf or .html to .txt
335342
@echo Setting .txt filetype to ascii docs.
336-
for /R %FB_OUTPUT_DIR%\doc %%v in ( * ) do (
343+
@for /R %FB_OUTPUT_DIR%\doc %%v in ( * ) do (
337344
if /I not "%%~xv" == ".md" (
338345
if /I not "%%~xv" == ".txt" (
339346
if /I not "%%~xv" == ".pdf" (
@@ -390,11 +397,11 @@ for /R %FB_OUTPUT_DIR%\doc %%v in ( * ) do (
390397
:: grab some missing bits'n'pieces from different parts of the source tree
391398
::=========================================================================
392399
@echo Copying ib_util etc
393-
@copy %FB_ROOT_PATH%\src\extlib\ib_util.h %FB_OUTPUT_DIR%\include > nul || (call :WARNING Copying ib_util.h failed. && @goto :EOF )
394-
@copy %FB_ROOT_PATH%\src\misc\pascal\ib_util.pas %FB_OUTPUT_DIR%\include > nul || (call :WARNING Copying ib_util.pas failed. && @goto :EOF )
400+
@copy %FB_ROOT_PATH%\src\extlib\ib_util.h %FB_OUTPUT_DIR%\include > nul || (call :WARNING Copying ib_util.h failed. & goto :EOF )
401+
@copy %FB_ROOT_PATH%\src\misc\pascal\ib_util.pas %FB_OUTPUT_DIR%\include > nul || (call :WARNING Copying ib_util.pas failed. & goto :EOF )
395402

396403
@echo Copying other include files required for development...
397-
set OUTPATH=%FB_OUTPUT_DIR%\include
404+
@set OUTPATH=%FB_OUTPUT_DIR%\include
398405
@copy %FB_ROOT_PATH%\src\yvalve\perf.h %OUTPATH%\ > nul
399406
@copy %FB_ROOT_PATH%\src\include\gen\firebird.pas %OUTPATH%\firebird\ > nul || (@call :ERROR Failure executing copy %FB_ROOT_PATH%\src\include\gen\firebird.pas %OUTPATH%\firebird\ )
400407
@if ERRORLEVEL 1 goto :END
@@ -424,7 +431,7 @@ set OUTPATH=%FB_OUTPUT_DIR%\include
424431
::=================================================================
425432
@if not exist %FB_OUTPUT_DIR%\firebird.msg (
426433
copy %FB_GEN_DIR%\firebird.msg %FB_OUTPUT_DIR%\firebird.msg > nul
427-
if ERRORLEVEL 1 ( call :ERROR Could not copy firebird.msg & goto :EOF )
434+
if ERRORLEVEL 1 ( call :ERROR Could not copy firebird.msg & goto :EOF )
428435
)
429436

430437
::End of FB_MSG
@@ -437,7 +444,7 @@ set OUTPATH=%FB_OUTPUT_DIR%\include
437444
:: that and they all have windows EOL
438445
::===============================================
439446
@for /R %FB_OUTPUT_DIR% %%W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.pas *.e *.def *.rc *.md *.html ) do (
440-
unix2dos --quiet --safe %%W || exit /b 1
447+
unix2dos --safe %%W > nul 2>&1 || exit /b 1
441448
)
442449

443450
::End of SET_CRLF
@@ -627,40 +634,40 @@ popd
627634

628635
@echo.
629636
@echo Reading command-line parameters...
630-
@(@call :SET_PARAMS %* )
631-
@if ERRORLEVEL 1 (@call :ERROR Calling SET_PARAMS & goto :END)
637+
@(call :SET_PARAMS %* )
638+
@if ERRORLEVEL 1 (call :ERROR Calling SET_PARAMS & goto :END)
632639

633640
@echo.
634641
@echo Checking that all required components are available...
635-
@(@call :CHECK_ENVIRONMENT ) || ( @echo Error calling CHECK_ENVIRONMENT && @goto :END )
642+
@( call :CHECK_ENVIRONMENT ) || ( echo Error calling CHECK_ENVIRONMENT & goto :END )
636643
@echo.
637644

638645
@echo Setting version number...
639-
@(@call :SET_VERSION ) || (@echo Error calling SET_VERSION && @goto :END )
646+
@( call :SET_VERSION ) || ( echo Error calling SET_VERSION & goto :END )
640647
@echo.
641648

642649
@echo Copying additional files needed for installation, documentation etc.
643-
@( @call :COPY_XTRA ) || ( @echo Error calling COPY_XTRA && @goto :END )
650+
@( call :COPY_XTRA ) || ( echo Error calling COPY_XTRA & goto :END )
644651
@echo.
645652

646653
:: WIX is not necessary for a snapshot build, so we don't throw
647654
:: an error if WIX is not defined. On the other hand,
648655
:: if it is there anyway, use it.
649656
@if defined WIX (
650657
echo Building MSI runtimes
651-
( call :BUILD_CRT_MSI ) || ( echo Error calling BUILD_CRT_MSI & @goto :END )
658+
( call :BUILD_CRT_MSI ) || ( echo Error calling BUILD_CRT_MSI & goto :END )
652659
echo.
653660
)
654661

655662
@echo Prepare include directory
656-
@( call :INCLUDE_DIR ) || ( @echo Error calling INCLUDE_DIR & @goto :END )
663+
@( call :INCLUDE_DIR ) || ( echo Error calling INCLUDE_DIR & goto :END )
657664
@echo.
658665

659666
@echo Writing databases conf
660-
@(call :DB_CONF ) || ( echo Error calling DB_CONF & goto :END )
667+
@( call :DB_CONF ) || ( echo Error calling DB_CONF & goto :END )
661668
@echo.
662669
@echo Copying firebird.msg
663-
@(call :FB_MSG ) || ( echo Error calling FB_MSG & goto :END )
670+
@( call :FB_MSG ) || ( echo Error calling FB_MSG & goto :END )
664671
@echo.
665672

666673
@echo Fix up line endings...
@@ -675,7 +682,7 @@ popd
675682

676683
@if %FBBUILD_ISX_PACK% EQU 1 (
677684
echo Now let's compile the InnoSetup scripts
678-
( call :ISX_PACK ) || ( echo Error calling ISX_PACK & goto :END )
685+
( call :ISX_PACK ) || ( echo Error calling ISX_PACK & goto :END )
679686
echo.
680687
)
681688

@@ -698,4 +705,3 @@ popd
698705

699706
exit /b %ERRLEV%
700707

701-

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

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
; for the specific language governing rights and limitations under the
99
; License.
1010
;
11-
; The Original Code is copyright 2001-2021 Paul Reeves for IBPhoenix.
11+
; The Original Code is copyright 2001-2024 Paul Reeves for IBPhoenix.
1212
;
1313
; The Initial Developer of the Original Code is Paul Reeves for IBPhoenix.
1414
;
@@ -586,7 +586,6 @@ Source: {#FilesDir}\misc\*.*; DestDir: {app}\misc; Components: ServerComponent;
586586

587587
Source: {#FilesDir}\tzdata\*.*; DestDir: {app}\tzdata; Components: ClientComponent; Flags: ignoreversion;
588588

589-
;Source: {#FilesDir}\system32\Firebird2Control.cpl; DestDir: {sys}; Components: ServerComponent; MinVersion: {#MinVer}; Flags: sharedfile ignoreversion promptifolder restartreplace uninsrestartdelete; Check: InstallCPLApplet
590589
#endif /* files */
591590

592591
#ifdef examples
@@ -883,19 +882,34 @@ var
883882
TempDir: String;
884883
ResultCode: Integer;
885884
CmdStr: string;
885+
InputStr: string;
886+
OutputStr: string;
886887
begin
887888
TempDir := ExpandConstant( '{tmp}' );
888889
CmdStr := ExpandConstant( '{app}\isql.exe' );
890+
InputStr := TempDir + '\' + 'temp.sql';
891+
OutputStr := InputStr + '.txt';
892+
893+
// Ensure these files do not already exist.
894+
if FileExists( InputStr ) then DeleteFile( InputStr );
895+
if FileExists( OutputStr ) then DeleteFile( OutputStr );
896+
889897
AStringList := TStringList.create;
890898
with AStringList do begin
891-
Add( 'create user ' + GetAdminUserName + ' password ''' + GetAdminUserPassword + ''' using plugin Srp;' );
892-
Add( 'commit;' ); //Technically exit implies a commit so this not necessary. OTOH, explicitly committing makes for more readable code.
899+
Add( 'create or alter user ' + GetAdminUserName + ' password ''' + GetAdminUserPassword + ''' using plugin Srp;' );
893900
Add( 'exit;' );
894-
SaveToFile( Tempdir +'\temp.sql' );
901+
SaveToFile( InputStr );
902+
end;
903+
Result := Exec( CmdStr , ' -m -m2 -user SYSDBA -i ' + InputStr + ' -o ' + OutputStr + ' employee ' , TempDir, SW_HIDE, ewWaitUntilTerminated, ResultCode );
904+
if ResultCode <> 0 then begin
905+
Result := False;
906+
Log( 'In function InitSecurityDB Exec isql returned ' + IntToStr(ResultCode) + ' executing ' + InputStr );
895907
end;
896-
Result := Exec( CmdStr , ' -m -m2 -user SYSDBA -i ' + TempDir + '\temp.sql -o ' + TempDir + '\temp.sql.txt employee ' , TempDir, SW_HIDE, ewWaitUntilTerminated, ResultCode );
897-
DeleteFile( TempDir + '\temp.sql');
898-
DeleteFile( TempDir + '\temp.sql.txt');
908+
if FindInFile( OutputStr, 'error' ) then begin
909+
Result := False;
910+
Log( 'In function InitSecurityDB FindInFile found an error in ' + OutputStr );
911+
end;
912+
899913
end;
900914
901915
@@ -1248,4 +1262,3 @@ end;
12481262
begin
12491263
end.
12501264
1251-
; kate: replace-tabs on; indent-width 2; tab-width 2; replace-tabs-save on; syntax Pascal;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ Const
118118
FB80_x64_Install = 26;
119119
FB90Install = 27;
120120
FB90_x64_Install = 28;
121+
MaxProdInstalled = FB90_x64_Install;
122+
121123
Current32Install = FB{#FB_MAJOR_VER}0Install;
122124
Current64Install = FB{#FB_MAJOR_VER}0_x64_Install;
123125

124-
MaxProdInstalled = FB90_x64_Install;
125126

126127
//ProductsInstalled
127128
IB4 = 0;
@@ -1046,7 +1047,7 @@ procedure SetupSharedFilesArray;
10461047
//to list them in the order they appear in the setup script
10471048
// Shared Files are defined as either:
10481049
// - Files which are absolutely necessary for a functioning installation.
1049-
// Hence gbak and gfix are shared files, isql is not
1050+
// Hence gbak and gfix are shared files, isql and qli are not
10501051
// - Libraries
10511052
// - License files
10521053
begin
@@ -1322,7 +1323,7 @@ begin
13221323
result := False;
13231324
if (ConfigureFirebird) then
13241325
result := WizardIsTaskSelected('UseSuperServerTask\UseGuardianTask')
1325-
or WizardIsTaskSelected('UseSuperClassicTask\UseGuardianTask');
1326+
or WizardIsTaskSelected('UseSuperClassicTask\UseGuardianTask');
13261327
end;
13271328

13281329

@@ -1451,7 +1452,6 @@ begin
14511452

14521453
//If existing install of the same majorver.minorver is
14531454
//found then we can upgrade it.
1454-
//// **** FIX ME **** Don't use hardcoded constants here. They get overlooked.
14551455
if ( (ProductsInstalledCount = 1) AND
14561456
#if PlatformTarget == "x64"
14571457
((ProductsInstalled AND FB{#FB_MAJOR_VER}0_x64 ) = FB{#FB_MAJOR_VER}0_x64 ) ) then begin

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
o EnumerateObjectList;
3131
- Simple demonstration of object enumeration.
3232
33-
o Show Help
33+
o Show Help
3434
- CreateHelpDlg;
3535
- ShowHelpDlg: Integer;
3636
- CloseHelpDlg;

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,20 @@ begin
356356
end;
357357

358358

359+
function FindInFile( Filename, StringToFind: String): Boolean;
360+
var
361+
i: Integer;
362+
AString: AnsiString;
363+
begin
364+
Result := False;
365+
LoadStringFromFile( Filename, Astring );
366+
i := Length( Astring );
367+
if i <> 0 then
368+
i := Pos ( StringToFind, Astring );
369+
if i <> 0 then Result := True;
370+
end;
371+
372+
359373
procedure DecodeVersion( VerStr: String; var VerInt: array of Integer );
360374
var
361375
i,p: Integer; s: string;

builds/install/arch-specific/win32/ba/Instalacija_ProcitajMe.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Pogledajte UNINSTALL sekciju ispod za vise informacija o ovome.
3838

3939
Ako ste instalirali beta ili alpha verziju
4040
firebird-a, instalacija ce preimenovati firebird.conf i
41-
security6.fdb jer ove datoteke vise nisu kompatibilne.
41+
security$MAJOR.fdb jer ove datoteke vise nisu kompatibilne.
4242

4343

4444
Deployment gds32.dll
@@ -69,7 +69,7 @@ Re-instalacija Firebird-a
6969

7070
Instalacioni program radi sve sto moze da detektuje i
7171
sacuva prethodnu instalaciju. Ako instalacija detektuje
72-
firebird.conf ili security6.fdb onda nece ponuditi
72+
firebird.conf ili security$MAJOR.fdb onda nece ponuditi
7373
opciju da instalira legacy_auth. Niti ce ponuditi
7474
opciju da postavi SYSDBA username i password.
7575

@@ -128,7 +128,7 @@ o Deinstalacija ostavlja 6 datoteka u install
128128
- fbtrace.conf
129129
- replication.conf
130130
- firebird.log
131-
- security6.fdb
131+
- security$MAJOR.fdb
132132

133133
Ovo je uradjeno namjerno. Ove datoteke su sve
134134
potencijalno modifikovane od strane korisnika i mogu

0 commit comments

Comments
 (0)