annotate deploy/win64/build-and-package.bat @ 2570:70146da96f3c

Added tag sv_v4.1 for changeset db7392b78cda
author Chris Cannam
date Thu, 18 Jun 2020 15:08:08 +0100
parents 22af3b429679
children be6a245c43f3
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@2451 16 if errorlevel 1 exit /b %errorlevel%
Chris@2451 17
Chris@2448 18 powershell -NoProfile -ExecutionPolicy Bypass -Command "& 'deploy\win64\generate-wxs.ps1'"
Chris@2451 19 if errorlevel 1 exit /b %errorlevel%
Chris@2448 20
Chris@2086 21 set ORIGINALPATH=%PATH%
Chris@2086 22 set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
Chris@2086 23 set NAME=Open Source Developer, Christopher Cannam
Chris@2086 24
Chris@2086 25 set ARG=%1
Chris@2086 26 shift
Chris@2086 27 if "%ARG%" == "sign" (
Chris@2086 28 @ echo NOTE: sign option specified, will attempt to codesign exe and msi
Chris@2086 29 @ echo NOTE: starting by codesigning an unrelated executable, so we know
Chris@2086 30 @ echo NOTE: whether it'll work before doing the entire build
Chris@2086 31 copy sv-dependency-builds\win64-msvc\bin\capnp.exe signtest.exe
Chris@2399 32 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a signtest.exe
Chris@2114 33 if errorlevel 1 exit /b %errorlevel%
Chris@2086 34 signtool verify /pa signtest.exe
Chris@2114 35 if errorlevel 1 exit /b %errorlevel%
Chris@2086 36 del signtest.exe
Chris@2086 37 @ echo NOTE: success
Chris@2086 38 ) else (
Chris@2086 39 @ echo NOTE: sign option not specified, will not codesign anything
Chris@2086 40 )
Chris@2086 41
Chris@2398 42 @echo(
Chris@1839 43 @echo Rebuilding 32-bit
Chris@1827 44
Chris@1827 45 cd %STARTPWD%
Chris@1841 46 del /q /s build_win32
Chris@2201 47 call .\deploy\win32\build-32.bat
Chris@1839 48 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 49
Chris@2086 50 if "%ARG%" == "sign" (
Chris@2086 51 @echo Signing 32-bit executables and libraries
Chris@2399 52 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a build_win32\release\*.exe build_win32\release\*.dll
Chris@2086 53 )
Chris@2086 54
Chris@1839 55 @echo Rebuilding 64-bit
Chris@1827 56
Chris@1839 57 cd %STARTPWD%
Chris@1841 58 del /q /s build_win64
Chris@1839 59 call .\deploy\win64\build-64.bat
Chris@1839 60 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 61
Chris@2086 62 if "%ARG%" == "sign" (
Chris@2086 63 @echo Signing 64-bit executables and libraries
Chris@2399 64 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a build_win64\release\*.exe build_win64\release\*.dll
Chris@2086 65 )
Chris@2086 66
Chris@1839 67 set PATH=%PATH%;"C:\Program Files (x86)\WiX Toolset v3.11\bin"
Chris@1827 68
Chris@1839 69 @echo Packaging 32-bit
Chris@1827 70
Chris@1839 71 cd %STARTPWD%\build_win32
Chris@1827 72 del sonic-visualiser.msi
Chris@1827 73 candle -v ..\deploy\win32\sonic-visualiser.wxs
Chris@1827 74 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
Chris@1839 75 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 76 del sonic-visualiser.wixobj
Chris@1827 77 del sonic-visualiser.wixpdb
Chris@1827 78
Chris@2086 79 if "%ARG%" == "sign" (
Chris@2086 80 @echo Signing 32-bit package
Chris@2399 81 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a sonic-visualiser.msi
Chris@2086 82 signtool verify /pa sonic-visualiser.msi
Chris@2086 83 )
Chris@2086 84
Chris@1839 85 @echo Packaging 64-bit
Chris@1827 86
Chris@1839 87 cd %STARTPWD%\build_win64
Chris@1827 88 del sonic-visualiser.msi
Chris@1827 89 candle -v ..\deploy\win64\sonic-visualiser.wxs
Chris@1827 90 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
Chris@1839 91 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827 92 del sonic-visualiser.wixobj
Chris@1827 93 del sonic-visualiser.wixpdb
Chris@1839 94
Chris@2086 95 if "%ARG%" == "sign" (
Chris@2086 96 @echo Signing 64-bit package
Chris@2399 97 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a sonic-visualiser.msi
Chris@2086 98 signtool verify /pa sonic-visualiser.msi
Chris@2086 99 )
Chris@2086 100
Chris@2086 101 set PATH=%ORIGINALPATH%
Chris@2086 102
Chris@2389 103 cd %STARTPWD%
Chris@1839 104 @echo Done
Chris@1839 105