Chris@685
|
1 rem Run this from within the top-level project dir: deploy\win32\build.bat
|
Chris@685
|
2
|
Chris@685
|
3 set STARTPWD=%CD%
|
Chris@685
|
4
|
Chris@685
|
5 if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" (
|
Chris@685
|
6 @ echo Could not find WiX Toolset
|
Chris@685
|
7 @ exit /b 2
|
Chris@685
|
8 )
|
Chris@685
|
9
|
Chris@685
|
10 if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.15.26706\x64\Microsoft.VC141.CRT" (
|
Chris@685
|
11 @ echo Could not find Windows CRT directory %CRTDIR%
|
Chris@685
|
12 @ exit /b 2
|
Chris@685
|
13 )
|
Chris@685
|
14
|
Chris@685
|
15 set ORIGINALPATH=%PATH%
|
Chris@685
|
16 set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
|
Chris@685
|
17 set CRTDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.15.26706\x64\Microsoft.VC141.CRT
|
Chris@685
|
18 set NAME=Open Source Developer, Christopher Cannam
|
Chris@685
|
19
|
Chris@685
|
20 set ARG=%1
|
Chris@685
|
21 shift
|
Chris@685
|
22 if "%ARG%" == "sign" (
|
Chris@685
|
23 @ echo NOTE: sign option specified, will attempt to codesign exe and msi
|
Chris@685
|
24 ) else (
|
Chris@685
|
25 @ echo NOTE: sign option not specified, will not codesign anything
|
Chris@685
|
26 )
|
Chris@685
|
27
|
Chris@685
|
28 cd %STARTPWD%
|
Chris@685
|
29 rem del /q /s build_win32
|
Chris@685
|
30 call .\deploy\win32\build.bat
|
Chris@685
|
31 if %errorlevel% neq 0 exit /b %errorlevel%
|
Chris@685
|
32
|
Chris@685
|
33 if not exist mercurial-4.8.0-x86.msi (
|
Chris@685
|
34 C:\ProgramData\chocolatey\bin\wget https://bitbucket.org/tortoisehg/files/downloads/mercurial-4.8.0-x86.msi
|
Chris@685
|
35 )
|
Chris@685
|
36 if %errorlevel% neq 0 exit /b %errorlevel%
|
Chris@685
|
37
|
Chris@685
|
38 if not exist mercurial-4.8.0-x86 (
|
Chris@685
|
39 msiexec /a mercurial-4.8.0-x86.msi /qn TARGETDIR=%STARTPWD%\mercurial-4.8.0-x86
|
Chris@685
|
40 )
|
Chris@685
|
41 if %errorlevel% neq 0 exit /b %errorlevel%
|
Chris@685
|
42
|
Chris@685
|
43 set HGDIR=%STARTPWD%\mercurial-4.8.0-x86
|
Chris@685
|
44
|
Chris@685
|
45 cd build_win32\release
|
Chris@685
|
46
|
Chris@685
|
47 copy "%CRTDIR%\concrt140.DLL" .
|
Chris@685
|
48 copy "%CRTDIR%\msvcp140.DLL" .
|
Chris@685
|
49 copy "%CRTDIR%\vccorlib140.DLL" .
|
Chris@685
|
50 copy "%CRTDIR%\vcruntime140.DLL" .
|
Chris@685
|
51
|
Chris@685
|
52 copy "%HGDIR%\PFiles\Mercurial\hg.exe" .
|
Chris@685
|
53 copy "%HGDIR%\PFiles\Mercurial\python27.dll" .
|
Chris@685
|
54
|
Chris@685
|
55 mkdir lib
|
Chris@685
|
56 copy "%HGDIR%\PFiles\Mercurial\lib\*" .\lib\
|
Chris@685
|
57
|
Chris@685
|
58 copy "%HGDIR%\windows\system32\msvcm90.dll" .
|
Chris@685
|
59 copy "%HGDIR%\windows\system32\msvcp90.dll" .
|
Chris@685
|
60 copy "%HGDIR%\windows\system32\msvcr90.dll" .
|
Chris@685
|
61
|
Chris@685
|
62 if "%ARG%" == "sign" (
|
Chris@685
|
63 @echo Signing components
|
Chris@685
|
64 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 *.dll *.exe lib\*
|
Chris@685
|
65 signtool verify /pa sonic-visualiser.msi
|
Chris@685
|
66 )
|
Chris@685
|
67
|
Chris@685
|
68 rem Todo: the rest
|