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

Misc upstream changes to support InnoSetup 5 and other enhancements to innosetup install script.

This commit is contained in:
paul_reeves 2007-06-22 12:21:25 +00:00
parent e182eb55e2
commit daeee1441b

View File

@ -113,23 +113,23 @@ if not DEFINED FB_EXTERNAL_DOCS (
sed --version | findstr version > nul
@if %ERRORLEVEL% GEQ 1 (
call :ERROR Could not locate sed
goto :EOF
call :ERROR Could not locate sed
goto :EOF
) else (@echo o sed found.)
if %FBBUILD_ZIP_PACK% EQU 1 (
if not defined SEVENZIP (
call :ERROR SEVENZIP environment variable is not defined.
@goto :EOF
call :ERROR SEVENZIP environment variable is not defined.
@goto :EOF
) else (@echo o Compression utility found.)
)
if %FBBUILD_ISX_PACK% EQU 1 (
if NOT DEFINED INNO_SETUP_PATH (
call :ERROR INNO_SETUP_PATH variable not defined
@goto :EOF
) else (@echo o Inno Setup found at %INNO_SETUP_PATH%.)
if NOT DEFINED INNO5_SETUP_PATH (
call :ERROR INNO5_SETUP_PATH variable not defined
@goto :EOF
) else (@echo o Inno Setup found at %INNO5_SETUP_PATH%.)
)
::End of CHECK_ENVIRONMENT
@ -146,19 +146,35 @@ if %FBBUILD_ISX_PACK% EQU 1 (
::========================================================
find "#define PRODUCT_VER_STRING" %FB_ROOT_PATH%\src\jrd\build_no.h > %temp%.\b$1.txt
sed -n -e s/\"//g -e s/"#define PRODUCT_VER_STRING "//w%temp%.\b$2.txt %temp%.\b$1.txt
for /f "tokens=*" %%a in ('type %temp%.\b$2.txt') do set PRODUCT_VER_STRING=%%a
for /f "tokens=*" %%a in ('type %temp%.\b$2.txt') do set FBBUILD_PRODUCT_VER_STRING=%%a
set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%_%FB_TARGET_PLATFORM%
find "#define FB_MAJOR_VER" %FB_ROOT_PATH%\src\jrd\build_no.h > %temp%.\b$1.txt
sed -n -e s/\"//g -e s/"#define FB_MAJOR_VER "//w%temp%.\b$2.txt %temp%.\b$1.txt
for /f "tokens=*" %%a in ('type %temp%.\b$2.txt') do set FB_MAJOR_VER=%%a
@echo s/-2.0.0-/-%PRODUCT_VER_STRING%-/ > %temp%.\b$3.txt
@echo s/define release/define %FBBUILD_BUILDTYPE%/ >> %temp%.\b$3.txt
@echo s/define msvc_version 7/define msvc_version %MSVC_VERSION%/ >> %temp%.\b$3.txt
find "#define FB_MINOR_VER" %FB_ROOT_PATH%\src\jrd\build_no.h > %temp%.\b$1.txt
sed -n -e s/\"//g -e s/"#define FB_MINOR_VER "//w%temp%.\b$2.txt %temp%.\b$1.txt
for /f "tokens=*" %%a in ('type %temp%.\b$2.txt') do set FB_MINOR_VER=%%a
find "#define FB_REV_NO" %FB_ROOT_PATH%\src\jrd\build_no.h > %temp%.\b$1.txt
sed -n -e s/\"//g -e s/"#define FB_REV_NO "//w%temp%.\b$2.txt %temp%.\b$1.txt
for /f "tokens=*" %%a in ('type %temp%.\b$2.txt') do set FB_REV_NO=%%a
find "#define FB_BUILD_NO" %FB_ROOT_PATH%\src\jrd\build_no.h > %temp%.\b$1.txt
sed -n -e s/\"//g -e s/"#define FB_BUILD_NO "//w%temp%.\b$2.txt %temp%.\b$1.txt
for /f "tokens=*" %%a in ('type %temp%.\b$2.txt') do set FB_BUILD_NO=%%a
set FBBUILD_FILE_ID=%FBBUILD_PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%_%FB_TARGET_PLATFORM%
::@echo s/-2.0.0-/-%FBBUILD_PRODUCT_VER_STRING%-/ > %temp%.\b$3.txt
@echo s/define release/define %FBBUILD_BUILDTYPE%/ > %temp%.\b$3.txt
@echo s/define msvc_version 8/define msvc_version %MSVC_VERSION%/ >> %temp%.\b$3.txt
@echo s/define no_pdb/define %FBBUILD_SHIP_PDB%/ >> %temp%.\b$3.txt
@echo s/define package_number=\"0\"/define package_number=\"%FBBUILD_PACKAGE_NUMBER%\"/ >> %temp%.\b$3.txt
::@echo s/define package_number=\"0\"/define package_number=\"%FBBUILD_PACKAGE_NUMBER%\"/ >> %temp%.\b$3.txt
@echo s/define iss_release/define %ISS_BUILD_TYPE%/ >> %temp%.\b$3.txt
@echo s/define examples/define %ISS_EXAMPLES%/ >> %temp%.\b$3.txt
@echo s/define compression/define %ISS_COMPRESS%/ >> %temp%.\b$3.txt
@echo s/PRODUCT_VER_STRING/%PRODUCT_VER_STRING%/ >> %temp%.\b$3.txt
@echo s/FBBUILD_PRODUCT_VER_STRING/%FBBUILD_PRODUCT_VER_STRING%/ >> %temp%.\b$3.txt
sed -f %temp%.\b$3.txt FirebirdInstall_20.iss > FirebirdInstall_%FBBUILD_FILE_ID%.iss
del %temp%.\b$?.txt
@ -179,18 +195,18 @@ del %temp%.\b$?.txt
if not exist %FB_OUTPUT_DIR%\system32 (mkdir %FB_OUTPUT_DIR%\system32)
@if DEFINED MSDevDir (
@if %MSVC_VERSION% EQU 6 (
@copy "%MSDevDir%\vcredist\msvcrt.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%MSDevDir%\vcredist\msvcp%MSVC_VERSION%0.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%MSDevDir%\vcredist\msvcrt.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%MSDevDir%\vcredist\msvcp%MSVC_VERSION%0.dll" %FB_OUTPUT_DIR%\bin\ > nul
)
) else (
if %MSVC_VERSION% EQU 8 (
@copy "%VCINSTALLDIR%\redist\%PROCESSOR_ARCHITECTURE%\Microsoft.VC80.CRT\msvcp%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%VCINSTALLDIR%\redist\%PROCESSOR_ARCHITECTURE%\Microsoft.VC80.CRT\msvcr%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%VCINSTALLDIR%\redist\%PROCESSOR_ARCHITECTURE%\Microsoft.VC80.CRT\msvcp%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%VCINSTALLDIR%\redist\%PROCESSOR_ARCHITECTURE%\Microsoft.VC80.CRT\msvcr%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
) else (
if %MSVC_VERSION% EQU 7 (
@copy "%FrameworkSDKDir%\bin\msvcp%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%FrameworkSDKDir%\bin\msvcr%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
)
if %MSVC_VERSION% EQU 7 (
@copy "%FrameworkSDKDir%\bin\msvcp%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
@copy "%FrameworkSDKDir%\bin\msvcr%MSVC_VERSION%?.dll" %FB_OUTPUT_DIR%\bin\ > nul
)
)
)
@if %ERRORLEVEL% GEQ 1 ( (call :ERROR Copying MSVC runtime library failed with error %ERRORLEVEL% ) & (goto :EOF))
@ -225,11 +241,11 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
@if "%FBBUILD_SHIP_PDB%"=="ship_pdb" (
@echo Copying pdb files...
for %%v in ( fbembed fb_inet_server fbserver fbclient ) do (
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\%%v\%%v.pdb %FB_OUTPUT_DIR%\bin > nul
@if %ERRORLEVEL% GEQ 1 (
call :ERROR Copying %%v.pdb files failed
goto :EOF
)
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\%%v\%%v.pdb %FB_OUTPUT_DIR%\bin > nul
@if %ERRORLEVEL% GEQ 1 (
call :ERROR Copying %%v.pdb files failed
goto :EOF
)
)
)
:: @copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\firebird\bin\*.pdb %FB_OUTPUT_DIR%\bin > nul
@ -248,16 +264,16 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
for %%v in ( ib_udf.sql ib_udf2.sql ) do (
copy %FB_ROOT_PATH%\src\extlib\%%v %FB_OUTPUT_DIR%\UDF\%%v > nul
@if %ERRORLEVEL% GEQ 1 (
call :ERROR Copying %FB_ROOT_PATH%\src\extlib\%%v failed.
goto :EOF
call :ERROR Copying %FB_ROOT_PATH%\src\extlib\%%v failed.
goto :EOF
)
)
for %%v in ( fbudf.sql fbudf.txt ) do (
copy %FB_ROOT_PATH%\src\extlib\fbudf\%%v %FB_OUTPUT_DIR%\UDF\%%v > nul
@if %ERRORLEVEL% GEQ 1 (
call :ERROR Copying %FB_ROOT_PATH%\src\extlib\%%v failed with error %ERRORLEVEL%
goto :EOF
call :ERROR Copying %FB_ROOT_PATH%\src\extlib\%%v failed with error %ERRORLEVEL%
goto :EOF
)
)
@ -302,7 +318,7 @@ mkdir %FB_OUTPUT_DIR%\misc\upgrade\ib_udf 2>nul
:: Add license
for %%v in (IPLicense.txt IDPLicense.txt ) do (
@copy %FB_ROOT_PATH%\builds\install\misc\%%v %FB_OUTPUT_DIR%\%%v > nul
@copy %FB_ROOT_PATH%\builds\install\misc\%%v %FB_OUTPUT_DIR%\%%v > nul
)
:: And readme
@ -313,15 +329,15 @@ echo Setting .txt filetype to ascii docs.
for /R %FB_OUTPUT_DIR%\doc %%v in (.) do (
pushd %%v
for /F %%W in ( 'dir /B /A-D' ) do (
if /I "%%~xW" NEQ ".txt" (
if /I "%%~xW" NEQ ".pdf" (
if /I "%%~xW" NEQ ".htm" (
if /I "%%~xW" NEQ ".html" (
ren %%W %%W.txt
)
)
)
)
if /I "%%~xW" NEQ ".txt" (
if /I "%%~xW" NEQ ".pdf" (
if /I "%%~xW" NEQ ".htm" (
if /I "%%~xW" NEQ ".html" (
ren %%W %%W.txt
)
)
)
)
)
popd
)
@ -402,9 +418,9 @@ mkdir %FB_OUTPUT_DIR%\misc\upgrade\metadata 2>nul
:: Make sure that qli's help.fdb is available
::===============================================
@if not exist %FB_OUTPUT_DIR%\help\help.fdb (
(@echo Copying help.fdb for qli support)
(@copy %FB_ROOT_PATH%\gen\dbs\help.fdb %FB_OUTPUT_DIR%\help\help.fdb > nul)
(@if %ERRORLEVEL% GEQ 1 ( (call :ERROR Could not copy qli help database ) & (goto :EOF)))
(@echo Copying help.fdb for qli support)
(@copy %FB_ROOT_PATH%\gen\dbs\help.fdb %FB_OUTPUT_DIR%\help\help.fdb > nul)
(@if %ERRORLEVEL% GEQ 1 ( (call :ERROR Could not copy qli help database ) & (goto :EOF)))
)
::End of GBAK_SEC_DB
@ -418,8 +434,8 @@ mkdir %FB_OUTPUT_DIR%\misc\upgrade\metadata 2>nul
:: in builds\win32 by build_msg.bat. Copying from there to output dir
::=================================================================
@if not exist %FB_OUTPUT_DIR%\firebird.msg (
(@copy %FB_ROOT_PATH%\gen\firebird.msg %FB_OUTPUT_DIR%\firebird.msg > nul)
(@if %ERRORLEVEL% GEQ 1 ( (call :ERROR Could not copy firebird.msg ) & (goto :EOF)))
(@copy %FB_ROOT_PATH%\gen\firebird.msg %FB_OUTPUT_DIR%\firebird.msg > nul)
(@if %ERRORLEVEL% GEQ 1 ( (call :ERROR Could not copy firebird.msg ) & (goto :EOF)))
)
::End of FB_MSG
@ -446,17 +462,18 @@ if not exist %FBBUILD_ZIP_PACK_ROOT% @mkdir %FBBUILD_ZIP_PACK_ROOT% 2>nul
@del /s /q %FBBUILD_ZIP_PACK_ROOT%\ > nul
@copy /Y %FB_OUTPUT_DIR% %FBBUILD_ZIP_PACK_ROOT% > nul
for %%v in (bin doc doc\sql.extensions help include intl lib udf misc misc\upgrade misc\upgrade\ib_udf misc\upgrade\security misc\upgrade\metadata system32 ) do (
@mkdir %FBBUILD_ZIP_PACK_ROOT%\%%v 2>nul
@copy /Y %FB_OUTPUT_DIR%\%%v\*.* %FBBUILD_ZIP_PACK_ROOT%\%%v\ > nul
@mkdir %FBBUILD_ZIP_PACK_ROOT%\%%v 2>nul
@dir /A-D %FB_OUTPUT_DIR%\%%v\*.* > nul 2>nul
if not ERRORLEVEL 1 @copy /Y %FB_OUTPUT_DIR%\%%v\*.* %FBBUILD_ZIP_PACK_ROOT%\%%v\ > nul
)
@if %FB2_EXAMPLES% equ 1 for %%v in (examples examples\api examples\dyn examples\empbuild examples\include examples\stat examples\udf examples\build_win32 ) do (
@mkdir %FBBUILD_ZIP_PACK_ROOT%\%%v 2>nul
@copy /Y %FB_OUTPUT_DIR%\%%v\*.* %FBBUILD_ZIP_PACK_ROOT%\%%v\ > nul
@mkdir %FBBUILD_ZIP_PACK_ROOT%\%%v 2>nul
dir %FB_OUTPUT_DIR%\%%v\*.* > nul 2>nul
if not ERRORLEVEL 1 @copy /Y %FB_OUTPUT_DIR%\%%v\*.* %FBBUILD_ZIP_PACK_ROOT%\%%v\ > nul
)
:: Now remove stuff that is not needed.
setlocal
set FB_RM_FILE_LIST=doc\installation_readme.txt bin\gpre_boot.exe bin\gpre_static.exe bin\gpre_embed.exe bin\gbak_embed.exe bin\isql_embed.exe bin\gds32.dll bin\btyacc.exe bin\fbrmclib.dll
@ -486,16 +503,16 @@ goto :EOF
::=======
if %FBBUILD_ZIP_PACK% EQU 0 goto :EOF
if "%FBBUILD_SHIP_PDB%" == "ship_pdb" (
if exist %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip (
@del %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%_pdb.zip
)
set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%_pdb.zip
if exist %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip (
@del %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%_pdb.zip
)
set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%_pdb.zip
) else (
if exist %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip (
@del %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip
)
set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip
if exist %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip (
@del %FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip
)
set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip
)
@%SEVENZIP%\7z.exe a -r -tzip -mx9 %FBBUILD_ZIPFILE% %FBBUILD_ZIP_PACK_ROOT%\*.*
@ -538,7 +555,7 @@ if "%FBBUILD_SHIP_PDB%"=="ship_pdb" (
:: Add license
for %%v in (IPLicense.txt IDPLicense.txt ) do (
@copy %FB_ROOT_PATH%\builds\install\misc\%%v %FBBUILD_EMB_PACK_ROOT%\%%v > nul
@copy %FB_ROOT_PATH%\builds\install\misc\%%v %FBBUILD_EMB_PACK_ROOT%\%%v > nul
)
:: And readme
@ -579,9 +596,9 @@ goto :EOF
setlocal
set TIMESTRING=0%PRODUCT_VER_STRING:~0,1%:0%PRODUCT_VER_STRING:~2,1%:0%PRODUCT_VER_STRING:~4,1%
@if /I "%BUILDTYPE%"=="release" (
(@echo Touching release build files with %TIMESTRING% timestamp) & (touch -s -D -t%TIMESTRING% %FB_OUTPUT_DIR%\*.*)
(if %FBBUILD_EMB_PACK% EQU 1 (@echo Touching release build files with %TIMESTRING% timestamp) & (touch -s -D -t%TIMESTRING% %FB_ROOT_PATH%\emb_pack\*.*) )
(if %FBBUILD_ZIP_PACK% EQU 1 (@echo Touching release build files with %TIMESTRING% timestamp) & (touch -s -D -t%TIMESTRING% %FB_ROOT_PATH%\zip_pack\*.*) )
(@echo Touching release build files with %TIMESTRING% timestamp) & (touch -s -D -t%TIMESTRING% %FB_OUTPUT_DIR%\*.*)
(if %FBBUILD_EMB_PACK% EQU 1 (@echo Touching release build files with %TIMESTRING% timestamp) & (touch -s -D -t%TIMESTRING% %FB_ROOT_PATH%\emb_pack\*.*) )
(if %FBBUILD_ZIP_PACK% EQU 1 (@echo Touching release build files with %TIMESTRING% timestamp) & (touch -s -D -t%TIMESTRING% %FB_ROOT_PATH%\zip_pack\*.*) )
)
endlocal
::End of TOUCH_ALL
@ -596,7 +613,7 @@ endlocal
if %FBBUILD_ISX_PACK% NEQ 1 goto :EOF
@Echo Now let's compile the InnoSetup scripts
@Echo.
"%INNO_SETUP_PATH%"\iscc %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall_%FBBUILD_FILE_ID%.iss
"%INNO5_SETUP_PATH%"\iscc %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall_%FBBUILD_FILE_ID%.iss
@echo.
::End of ISX_PACK
@ -619,7 +636,7 @@ if %FBBUILD_ISX_PACK% NEQ 1 goto :EOF
@echo (These files roughly double the size of the package.)
@echo.
@echo ISX Create installable binary from InnoSetup Extensions compiler.
@echo (You need to set the INNO_SETUP_PATH environment variable.)
@echo (You need to set the INNO5_SETUP_PATH environment variable.)
@echo.
@echo ZIP Create Zip package.
@echo (SEVENZIP is currently used and the SEVENZIP env var must be set.)