comparison deploy/win64/build-and-package.bat @ 2086:a594146c1ed8

Add code-signing support
author Chris Cannam
date Fri, 09 Nov 2018 15:23:02 +0000
parents 9f26f92bf89f
children 3fc52a2fadce
comparison
equal deleted inserted replaced
2079:63da6a82c12d 2086:a594146c1ed8
10 if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" ( 10 if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" (
11 @ echo Could not find WiX Toolset 11 @ echo Could not find WiX Toolset
12 @ exit /b 2 12 @ exit /b 2
13 ) 13 )
14 14
15 set ORIGINALPATH=%PATH%
16 set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
17 set NAME=Open Source Developer, Christopher Cannam
18
19 set ARG=%1
20 shift
21 if "%ARG%" == "sign" (
22 @ echo NOTE: sign option specified, will attempt to codesign exe and msi
23 @ echo NOTE: starting by codesigning an unrelated executable, so we know
24 @ echo NOTE: whether it'll work before doing the entire build
25 copy sv-dependency-builds\win64-msvc\bin\capnp.exe signtest.exe
26 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 signtest.exe
27 if %errorlevel% neq 0 exit /b %errorlevel%
28 signtool verify /pa signtest.exe
29 if %errorlevel% neq 0 exit /b %errorlevel%
30 del signtest.exe
31 @ echo NOTE: success
32 ) else (
33 @ echo NOTE: sign option not specified, will not codesign anything
34 )
35
36 @echo ""
15 @echo Rebuilding 32-bit 37 @echo Rebuilding 32-bit
16 38
17 cd %STARTPWD% 39 cd %STARTPWD%
18 del /q /s build_win32 40 del /q /s build_win32
19 call .\deploy\win64\build-32.bat 41 call .\deploy\win64\build-32.bat
20 if %errorlevel% neq 0 exit /b %errorlevel% 42 if %errorlevel% neq 0 exit /b %errorlevel%
21 43
44 if "%ARG%" == "sign" (
45 @echo Signing 32-bit executables and libraries
46 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 build_win32\release\*.exe build_win32\release\*.dll
47 )
48
22 @echo Rebuilding 64-bit 49 @echo Rebuilding 64-bit
23 50
24 cd %STARTPWD% 51 cd %STARTPWD%
25 del /q /s build_win64 52 del /q /s build_win64
26 call .\deploy\win64\build-64.bat 53 call .\deploy\win64\build-64.bat
27 if %errorlevel% neq 0 exit /b %errorlevel% 54 if %errorlevel% neq 0 exit /b %errorlevel%
55
56 if "%ARG%" == "sign" (
57 @echo Signing 64-bit executables and libraries
58 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 build_win32\release\*.exe build_win64\release\*.dll
59 )
28 60
29 set PATH=%PATH%;"C:\Program Files (x86)\WiX Toolset v3.11\bin" 61 set PATH=%PATH%;"C:\Program Files (x86)\WiX Toolset v3.11\bin"
30 62
31 @echo Packaging 32-bit 63 @echo Packaging 32-bit
32 64
36 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj 68 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
37 if %errorlevel% neq 0 exit /b %errorlevel% 69 if %errorlevel% neq 0 exit /b %errorlevel%
38 del sonic-visualiser.wixobj 70 del sonic-visualiser.wixobj
39 del sonic-visualiser.wixpdb 71 del sonic-visualiser.wixpdb
40 72
73 if "%ARG%" == "sign" (
74 @echo Signing 32-bit package
75 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 sonic-visualiser.msi
76 signtool verify /pa sonic-visualiser.msi
77 )
78
41 @echo Packaging 64-bit 79 @echo Packaging 64-bit
42 80
43 cd %STARTPWD%\build_win64 81 cd %STARTPWD%\build_win64
44 del sonic-visualiser.msi 82 del sonic-visualiser.msi
45 candle -v ..\deploy\win64\sonic-visualiser.wxs 83 candle -v ..\deploy\win64\sonic-visualiser.wxs
46 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj 84 light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
47 if %errorlevel% neq 0 exit /b %errorlevel% 85 if %errorlevel% neq 0 exit /b %errorlevel%
48 del sonic-visualiser.wixobj 86 del sonic-visualiser.wixobj
49 del sonic-visualiser.wixpdb 87 del sonic-visualiser.wixpdb
50 88
89 if "%ARG%" == "sign" (
90 @echo Signing 64-bit package
91 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 sonic-visualiser.msi
92 signtool verify /pa sonic-visualiser.msi
93 )
94
95 set PATH=%ORIGINALPATH%
96
51 @echo Done 97 @echo Done
52 98