Chris@1839: rem  Run this from within the top-level SV dir: deploy\win64\build-and-package.bat
Chris@1827: 
Chris@1827: set STARTPWD=%CD%
Chris@1827: 
Chris@1827: if not exist "C:\Program Files (x86)\SMLNJ\bin" (
Chris@1827: @   echo Could not find SML/NJ, required for Repoint
Chris@1841: @   exit /b 2
Chris@1827: )
Chris@1827: 
Chris@1827: if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" (
Chris@1827: @   echo Could not find WiX Toolset
Chris@1841: @   exit /b 2
Chris@1827: )
Chris@1827: 
Chris@2086: set ORIGINALPATH=%PATH%
Chris@2086: set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
Chris@2086: set NAME=Open Source Developer, Christopher Cannam
Chris@2086: 
Chris@2086: set ARG=%1
Chris@2086: shift
Chris@2086: if "%ARG%" == "sign" (
Chris@2086: @   echo NOTE: sign option specified, will attempt to codesign exe and msi
Chris@2086: @   echo NOTE: starting by codesigning an unrelated executable, so we know
Chris@2086: @   echo NOTE: whether it'll work before doing the entire build
Chris@2086: copy sv-dependency-builds\win64-msvc\bin\capnp.exe signtest.exe
Chris@2086: signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 signtest.exe
Chris@2114: if errorlevel 1 exit /b %errorlevel%
Chris@2086: signtool verify /pa signtest.exe
Chris@2114: if errorlevel 1 exit /b %errorlevel%
Chris@2086: del signtest.exe
Chris@2086: @   echo NOTE: success
Chris@2086: ) else (
Chris@2086: @   echo NOTE: sign option not specified, will not codesign anything
Chris@2086: )
Chris@2086: 
Chris@2086: @echo ""
Chris@1839: @echo Rebuilding 32-bit
Chris@1827: 
Chris@1827: cd %STARTPWD%
Chris@1841: del /q /s build_win32
Chris@2201: call .\deploy\win32\build-32.bat
Chris@1839: if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827: 
Chris@2086: if "%ARG%" == "sign" (
Chris@2086: @echo Signing 32-bit executables and libraries
Chris@2086: signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 build_win32\release\*.exe build_win32\release\*.dll
Chris@2086: )
Chris@2086: 
Chris@1839: @echo Rebuilding 64-bit
Chris@1827: 
Chris@1839: cd %STARTPWD%
Chris@1841: del /q /s build_win64
Chris@1839: call .\deploy\win64\build-64.bat
Chris@1839: if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827: 
Chris@2086: if "%ARG%" == "sign" (
Chris@2086: @echo Signing 64-bit executables and libraries
Chris@2086: signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 build_win32\release\*.exe build_win64\release\*.dll
Chris@2086: )
Chris@2086: 
Chris@1839: set PATH=%PATH%;"C:\Program Files (x86)\WiX Toolset v3.11\bin"
Chris@1827: 
Chris@1839: @echo Packaging 32-bit
Chris@1827: 
Chris@1839: cd %STARTPWD%\build_win32
Chris@1827: del sonic-visualiser.msi
Chris@1827: candle -v ..\deploy\win32\sonic-visualiser.wxs
Chris@1827: light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
Chris@1839: if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827: del sonic-visualiser.wixobj
Chris@1827: del sonic-visualiser.wixpdb
Chris@1827: 
Chris@2086: if "%ARG%" == "sign" (
Chris@2086: @echo Signing 32-bit package
Chris@2086: signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 sonic-visualiser.msi
Chris@2086: signtool verify /pa sonic-visualiser.msi
Chris@2086: )
Chris@2086: 
Chris@1839: @echo Packaging 64-bit
Chris@1827: 
Chris@1839: cd %STARTPWD%\build_win64
Chris@1827: del sonic-visualiser.msi
Chris@1827: candle -v ..\deploy\win64\sonic-visualiser.wxs
Chris@1827: light -b . -ext WixUIExtension -ext WixUtilExtension -v sonic-visualiser.wixobj
Chris@1839: if %errorlevel% neq 0 exit /b %errorlevel%
Chris@1827: del sonic-visualiser.wixobj
Chris@1827: del sonic-visualiser.wixpdb
Chris@1839: 
Chris@2086: if "%ARG%" == "sign" (
Chris@2086: @echo Signing 64-bit package
Chris@2086: signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 sonic-visualiser.msi
Chris@2086: signtool verify /pa sonic-visualiser.msi
Chris@2086: )
Chris@2086: 
Chris@2086: set PATH=%ORIGINALPATH%
Chris@2086: 
Chris@1839: @echo Done
Chris@1839: