annotate win32-build/build.cmd @ 164:a7d9c6142f8f tip

Added tag v1.2 for changeset 4a97f7638ffd
author Chris Cannam
date Thu, 06 Feb 2020 15:02:47 +0000
parents 643bae02d652
children
rev   line source
Chris@161 1
Chris@161 2 rem Run this from within the top-level project dir: win32-build\build.cmd
Chris@161 3
Chris@161 4 rem NB this nowadays only makes a 64-bit Windows build, not a 32-bit one!
Chris@161 5
Chris@161 6 echo on
Chris@161 7
Chris@161 8 set STARTPWD=%CD%
Chris@161 9
Chris@161 10 set vcvarsall="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat"
Chris@161 11
Chris@161 12 if not exist %vcvarsall% (
Chris@161 13 @ echo "Could not find MSVC vars batch file"
Chris@161 14 @ exit /b 2
Chris@161 15 )
Chris@161 16
Chris@161 17 set WIXDIR=C:\Program Files (x86)\WiX Toolset v3.11
Chris@161 18 if not exist "%WIXDIR%\bin" (
Chris@161 19 @ echo Could not find WiX Toolset
Chris@161 20 @ exit /b 2
Chris@161 21 )
Chris@161 22
Chris@161 23 set NAME=Open Source Developer, Christopher Cannam
Chris@161 24
Chris@161 25 set ORIGINALPATH=%PATH%
Chris@161 26 set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
Chris@161 27
Chris@161 28 set ARG=%1
Chris@161 29 shift
Chris@161 30 if "%ARG%" == "sign" (
Chris@161 31 @ echo NOTE: sign option specified, will attempt to codesign exe and msi
Chris@161 32 @ echo NOTE: starting by codesigning an unrelated executable, so we know
Chris@161 33 @ echo NOTE: whether it'll work before doing the entire build
Chris@161 34 copy "%WIXDIR%\bin\light.exe" signtest.exe
Chris@161 35 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a signtest.exe
Chris@161 36 if errorlevel 1 exit /b %errorlevel%
Chris@161 37 signtool verify /pa signtest.exe
Chris@161 38 if errorlevel 1 exit /b %errorlevel%
Chris@161 39 del signtest.exe
Chris@161 40 @ echo NOTE: success
Chris@161 41 ) else (
Chris@161 42 @ echo NOTE: sign option not specified, will not codesign anything
Chris@161 43 )
Chris@161 44
Chris@161 45 call %vcvarsall% amd64
Chris@161 46
Chris@161 47 set PATH=%SMLNJDIR%\bin;%WIXDIR%\bin;%PATH%
Chris@161 48
Chris@161 49 cd %STARTPWD%
Chris@161 50
Chris@161 51 cd win32-build
Chris@161 52 msbuild pyin.vcxproj /t:Rebuild /p:Configuration=Release
Chris@161 53 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@161 54
Chris@161 55 cd %STARTPWD%
Chris@161 56
Chris@161 57 call %vcvarsall% x86
Chris@161 58
Chris@161 59 cd win32-build
Chris@161 60 msbuild pyin.vcxproj /t:Rebuild /p:Configuration=Release
Chris@161 61 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@161 62
Chris@161 63 if "%ARG%" == "sign" (
Chris@161 64 @echo Signing plugins
Chris@161 65 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a Release\pyin.dll
Chris@161 66 signtool verify /pa Release\pyin.dll
Chris@161 67 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a x64\Release\pyin.dll
Chris@161 68 signtool verify /pa x64\Release\pyin.dll
Chris@161 69 )
Chris@161 70
Chris@161 71 del pyin.msi
Chris@161 72 candle -v pyin.wxs
Chris@161 73 light -ext WixUIExtension -v pyin.wixobj
Chris@161 74 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@161 75 del pyin.wixobj
Chris@161 76 del pyin.wixpdb
Chris@161 77
Chris@161 78 if "%ARG%" == "sign" (
Chris@161 79 @echo Signing package
Chris@161 80 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a pyin.msi
Chris@161 81 signtool verify /pa pyin.msi
Chris@161 82 )
Chris@161 83
Chris@161 84 set PATH=%ORIGINALPATH%
Chris@161 85
Chris@161 86 cd %STARTPWD%
Chris@161 87 @echo Done
Chris@161 88