Chris@685
|
1 rem Run this from within the top-level project dir: deploy\win32\build.bat
|
Chris@685
|
2
|
Chris@686
|
3 rem NB PyQt5 build command, in PyQt5_gpl-5.11.3 directory: c:\Python27\python.exe configure.py --qmake=c:\qt\5.12.0\msvc2017\bin\qmake.exe --sip=c:\Python27\sip.exe --disable=QtNfc
|
Chris@686
|
4
|
Chris@685
|
5 set STARTPWD=%CD%
|
Chris@685
|
6
|
Chris@685
|
7 if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" (
|
Chris@685
|
8 @ echo Could not find WiX Toolset
|
Chris@685
|
9 @ exit /b 2
|
Chris@685
|
10 )
|
Chris@685
|
11
|
Chris@685
|
12 if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.15.26706\x64\Microsoft.VC141.CRT" (
|
Chris@686
|
13 @ echo Could not find Windows CRT directory
|
Chris@686
|
14 @ exit /b 2
|
Chris@686
|
15 )
|
Chris@686
|
16
|
Chris@686
|
17 if not exist "C:/Python27/Lib/site-packages/PyQt5/" (
|
Chris@686
|
18 @ echo Could not find PyQt5 directory
|
Chris@686
|
19 @ exit /b 2
|
Chris@686
|
20 )
|
Chris@686
|
21
|
Chris@686
|
22 if not exist "C:/Python27/Lib/site-packages/Crypto/" (
|
Chris@686
|
23 @ echo Could not find PyCrypto directory
|
Chris@685
|
24 @ exit /b 2
|
Chris@685
|
25 )
|
Chris@685
|
26
|
Chris@685
|
27 set ORIGINALPATH=%PATH%
|
Chris@685
|
28 set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
|
Chris@685
|
29 set CRTDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.15.26706\x64\Microsoft.VC141.CRT
|
Chris@686
|
30 set PYQTDIR=C:/Python27/Lib/site-packages/PyQt5/
|
Chris@686
|
31 set PYCRYPTODIR=C:/Python27/Lib/site-packages/Crypto/
|
Chris@685
|
32 set NAME=Open Source Developer, Christopher Cannam
|
Chris@685
|
33
|
Chris@685
|
34 set ARG=%1
|
Chris@685
|
35 shift
|
Chris@685
|
36 if "%ARG%" == "sign" (
|
Chris@685
|
37 @ echo NOTE: sign option specified, will attempt to codesign exe and msi
|
Chris@685
|
38 ) else (
|
Chris@685
|
39 @ echo NOTE: sign option not specified, will not codesign anything
|
Chris@685
|
40 )
|
Chris@685
|
41
|
Chris@685
|
42 cd %STARTPWD%
|
Chris@685
|
43 rem del /q /s build_win32
|
Chris@685
|
44 call .\deploy\win32\build.bat
|
Chris@685
|
45 if %errorlevel% neq 0 exit /b %errorlevel%
|
Chris@685
|
46
|
Chris@685
|
47 if not exist mercurial-4.8.0-x86.msi (
|
Chris@685
|
48 C:\ProgramData\chocolatey\bin\wget https://bitbucket.org/tortoisehg/files/downloads/mercurial-4.8.0-x86.msi
|
Chris@685
|
49 )
|
Chris@685
|
50 if %errorlevel% neq 0 exit /b %errorlevel%
|
Chris@685
|
51
|
Chris@685
|
52 if not exist mercurial-4.8.0-x86 (
|
Chris@685
|
53 msiexec /a mercurial-4.8.0-x86.msi /qn TARGETDIR=%STARTPWD%\mercurial-4.8.0-x86
|
Chris@685
|
54 )
|
Chris@685
|
55 if %errorlevel% neq 0 exit /b %errorlevel%
|
Chris@685
|
56
|
Chris@685
|
57 set HGDIR=%STARTPWD%\mercurial-4.8.0-x86
|
Chris@685
|
58
|
Chris@685
|
59 cd build_win32\release
|
Chris@685
|
60
|
Chris@686
|
61 copy "%STARTPWD%\easyhg.py" .
|
Chris@686
|
62
|
Chris@685
|
63 copy "%CRTDIR%\concrt140.DLL" .
|
Chris@685
|
64 copy "%CRTDIR%\msvcp140.DLL" .
|
Chris@685
|
65 copy "%CRTDIR%\vccorlib140.DLL" .
|
Chris@685
|
66 copy "%CRTDIR%\vcruntime140.DLL" .
|
Chris@685
|
67
|
Chris@685
|
68 copy "%HGDIR%\PFiles\Mercurial\hg.exe" .
|
Chris@685
|
69 copy "%HGDIR%\PFiles\Mercurial\python27.dll" .
|
Chris@685
|
70
|
Chris@685
|
71 mkdir lib
|
Chris@686
|
72 copy "%HGDIR%\PFiles\Mercurial\lib\*" lib\
|
Chris@685
|
73
|
Chris@685
|
74 copy "%HGDIR%\windows\system32\msvcm90.dll" .
|
Chris@685
|
75 copy "%HGDIR%\windows\system32\msvcp90.dll" .
|
Chris@685
|
76 copy "%HGDIR%\windows\system32\msvcr90.dll" .
|
Chris@685
|
77
|
Chris@686
|
78 mkdir PyQt5
|
Chris@686
|
79 copy "%PYQTDIR%\..\sip.pyd" .
|
Chris@686
|
80 copy "%PYQTDIR%\__init__.py" PyQt5\
|
Chris@686
|
81 copy "%PYQTDIR%\QtCore.pyd" PyQt5\
|
Chris@686
|
82 copy "%PYQTDIR%\QtGui.pyd" PyQt5\
|
Chris@686
|
83 copy "%PYQTDIR%\QtWidgets.pyd" PyQt5\
|
Chris@686
|
84
|
Chris@686
|
85 mkdir Crypto
|
Chris@686
|
86 mkdir Crypto\Cipher
|
Chris@686
|
87 mkdir Crypto\Util
|
Chris@686
|
88
|
Chris@686
|
89 copy "%PYCRYPTODIR%\Cipher\__init__.py" Crypto\Cipher\
|
Chris@686
|
90 copy "%PYCRYPTODIR%\Cipher\_AES.pyd" Crypto\Cipher\
|
Chris@686
|
91 copy "%PYCRYPTODIR%\Cipher\AES.py" Crypto\Cipher\
|
Chris@686
|
92 copy "%PYCRYPTODIR%\Cipher\blockalgo.py" Crypto\Cipher\
|
Chris@686
|
93
|
Chris@686
|
94 copy "%PYCRYPTODIR%\Util\__init__.py" Crypto\Util\
|
Chris@686
|
95 copy "%PYCRYPTODIR%\Util\py3compat.py" Crypto\Util\
|
Chris@686
|
96
|
Chris@686
|
97 copy "%PYCRYPTODIR%\__init__.py" Crypto\
|
Chris@686
|
98
|
Chris@685
|
99 if "%ARG%" == "sign" (
|
Chris@685
|
100 @echo Signing components
|
Chris@685
|
101 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 *.dll *.exe lib\*
|
Chris@685
|
102 signtool verify /pa sonic-visualiser.msi
|
Chris@685
|
103 )
|
Chris@685
|
104
|
Chris@685
|
105 rem Todo: the rest
|