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