annotate deploy/win64/build-and-package.bat @ 2448:119588c42772

Generate the WXS files from templated inputs, substituting in the version and redistributable paths; also include OpenSSL libraries in the package, fixing #1895 Windows build fails to open https locations
author Chris Cannam
date Tue, 14 Jan 2020 13:23:04 +0000
parents ed0e83474d08
children 22af3b429679
rev   line source
Chris@1839 1 rem Run this from within the top-level SV dir: deploy\win64\build-and-package.bat
Chris@1827 2
Chris@1827 3 set STARTPWD=%CD%
Chris@1827 4
Chris@1827 5 if not exist "C:\Program Files (x86)\SMLNJ\bin" (
Chris@1827 6 @ echo Could not find SML/NJ, required for Repoint
Chris@1841 7 @ exit /b 2
Chris@1827 8 )
Chris@1827 9
Chris@1827 10 if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" (
Chris@1827 11 @ echo Could not find WiX Toolset
Chris@1841 12 @ exit /b 2
Chris@1827 13 )
Chris@1827 14
Chris@2448 15 powershell -NoProfile -ExecutionPolicy Bypass -Command "& 'deploy\win32\generate-wxs.ps1'"
Chris@2448 16 powershell -NoProfile -ExecutionPolicy Bypass -Command "& 'deploy\win64\generate-wxs.ps1'"
Chris@2448 17
Chris@2086 18 set ORIGINALPATH=%PATH%
Chris@2086 19 set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
Chris@2086 20 set NAME=Open Source Developer, Christopher Cannam
Chris@2086 21
Chris@2086 22 set ARG=%1
Chris@2086 23 shift
Chris@2086 24 if "%ARG%" == "sign" (
Chris@2086 25 @ echo NOTE: sign option specified, will attempt to codesign exe and msi
Chris@2086 26 @ echo NOTE: starting by codesigning an unrelated executable, so we know
Chris@2086 27 @ echo NOTE: whether it'll work before doing the entire build
Chris@2086 28 copy sv-dependency-builds\win64-msvc\bin\capnp.exe signtest.exe
Chris@2399 29 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a signtest.exe
Chris@2114 30 if errorlevel 1 exit /b %errorlevel%
Chris@2086 31 signtool verify /pa signtest.exe
Chris@2114 32 if errorlevel 1 exit /b %errorlevel%
Chris@2086 33 del signtest.exe
Chris@2086 34 @ echo NOTE: success
Chris@2086 35 ) else (
Chris@2086 36 @ echo NOTE: sign option not specified, will not codesign anything
Chris@2086 37 )
Chris@2086 38
Chris@2398 39 @echo(
Chris@1839 40 @echo Rebuilding 32-bit
Chris@1827 41
Chris@1827 42 cd %STARTPWD%
Chris@1841 43 del /q /s build_win32
Chris@2201 44 call .\deploy\win32\build-32.bat
Chris@1839 45 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 46
Chris@2086 47 if "%ARG%" == "sign" (
Chris@2086 48 @echo Signing 32-bit executables and libraries
Chris@2399 49 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a build_win32\release\*.exe build_win32\release\*.dll
Chris@2086 50 )
Chris@2086 51
Chris@1839 52 @echo Rebuilding 64-bit
Chris@1827 53
Chris@1839 54 cd %STARTPWD%
Chris@1841 55 del /q /s build_win64
Chris@1839 56 call .\deploy\win64\build-64.bat
Chris@1839 57 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 58
Chris@2086 59 if "%ARG%" == "sign" (
Chris@2086 60 @echo Signing 64-bit executables and libraries
Chris@2399 61 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a build_win64\release\*.exe build_win64\release\*.dll
Chris@2086 62 )
Chris@2086 63
Chris@1839 64 set PATH=%PATH%;"C:\Program Files (x86)\WiX Toolset v3.11\bin"
Chris@1827 65
Chris@1839 66 @echo Packaging 32-bit
Chris@1827 67
Chris@1839 68 cd %STARTPWD%\build_win32
Chris@1827 69 del sonic-visualiser.msi
Chris@1827 70 candle -v ..\deploy\win32\sonic-visualiser.wxs
Chris@1827 71 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
Chris@1839 72 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 73 del sonic-visualiser.wixobj
Chris@1827 74 del sonic-visualiser.wixpdb
Chris@1827 75
Chris@2086 76 if "%ARG%" == "sign" (
Chris@2086 77 @echo Signing 32-bit package
Chris@2399 78 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a sonic-visualiser.msi
Chris@2086 79 signtool verify /pa sonic-visualiser.msi
Chris@2086 80 )
Chris@2086 81
Chris@1839 82 @echo Packaging 64-bit
Chris@1827 83
Chris@1839 84 cd %STARTPWD%\build_win64
Chris@1827 85 del sonic-visualiser.msi
Chris@1827 86 candle -v ..\deploy\win64\sonic-visualiser.wxs
Chris@1827 87 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
Chris@1839 88 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 89 del sonic-visualiser.wixobj
Chris@1827 90 del sonic-visualiser.wixpdb
Chris@1839 91
Chris@2086 92 if "%ARG%" == "sign" (
Chris@2086 93 @echo Signing 64-bit package
Chris@2399 94 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a sonic-visualiser.msi
Chris@2086 95 signtool verify /pa sonic-visualiser.msi
Chris@2086 96 )
Chris@2086 97
Chris@2086 98 set PATH=%ORIGINALPATH%
Chris@2086 99
Chris@2389 100 cd %STARTPWD%
Chris@1839 101 @echo Done
Chris@1839 102