Chris@685: rem Run this from within the top-level project dir: deploy\win32\build.bat Chris@685: Chris@692: 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: 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: Chris@685: set STARTPWD=%CD% Chris@685: Chris@685: if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" ( Chris@685: @ echo Could not find WiX Toolset Chris@685: @ exit /b 2 Chris@685: ) Chris@685: Chris@733: if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.16.27012\x86\Microsoft.VC141.CRT" ( Chris@686: @ echo Could not find Windows CRT directory Chris@686: @ exit /b 2 Chris@686: ) Chris@686: Chris@686: if not exist "C:/Python27/Lib/site-packages/PyQt5/" ( Chris@686: @ echo Could not find PyQt5 directory Chris@686: @ exit /b 2 Chris@686: ) Chris@686: Chris@686: if not exist "C:/Python27/Lib/site-packages/Crypto/" ( Chris@686: @ echo Could not find PyCrypto directory Chris@685: @ exit /b 2 Chris@685: ) Chris@685: Chris@685: set ORIGINALPATH=%PATH% Chris@685: set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% Chris@733: set CRTDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.16.27012\x86\Microsoft.VC141.CRT Chris@693: set PYPACKAGEDIR=C:/Python27/Lib/site-packages Chris@693: set PYQTDIR=%PYPACKAGEDIR%/PyQt5/ Chris@693: set PYCRYPTODIR=%PYPACKAGEDIR%/Crypto/ Chris@685: set NAME=Open Source Developer, Christopher Cannam Chris@685: Chris@685: set ARG=%1 Chris@685: shift Chris@685: if "%ARG%" == "sign" ( Chris@685: @ echo NOTE: sign option specified, will attempt to codesign exe and msi Chris@685: ) else ( Chris@685: @ echo NOTE: sign option not specified, will not codesign anything Chris@685: ) Chris@685: Chris@685: cd %STARTPWD% Chris@698: del /q /s build_win32 Chris@685: call .\deploy\win32\build.bat Chris@685: if %errorlevel% neq 0 exit /b %errorlevel% Chris@685: Chris@685: if not exist mercurial-4.8.0-x86.msi ( Chris@685: C:\ProgramData\chocolatey\bin\wget https://bitbucket.org/tortoisehg/files/downloads/mercurial-4.8.0-x86.msi Chris@685: ) Chris@685: if %errorlevel% neq 0 exit /b %errorlevel% Chris@685: Chris@685: if not exist mercurial-4.8.0-x86 ( Chris@685: msiexec /a mercurial-4.8.0-x86.msi /qn TARGETDIR=%STARTPWD%\mercurial-4.8.0-x86 Chris@685: ) Chris@685: if %errorlevel% neq 0 exit /b %errorlevel% Chris@685: Chris@685: set HGDIR=%STARTPWD%\mercurial-4.8.0-x86 Chris@685: Chris@685: cd build_win32\release Chris@685: Chris@686: copy "%STARTPWD%\easyhg.py" . Chris@686: Chris@685: copy "%CRTDIR%\concrt140.DLL" . Chris@685: copy "%CRTDIR%\msvcp140.DLL" . Chris@685: copy "%CRTDIR%\vccorlib140.DLL" . Chris@685: copy "%CRTDIR%\vcruntime140.DLL" . Chris@685: Chris@685: copy "%HGDIR%\PFiles\Mercurial\hg.exe" . Chris@685: copy "%HGDIR%\PFiles\Mercurial\python27.dll" . Chris@685: Chris@685: mkdir lib Chris@686: copy "%HGDIR%\PFiles\Mercurial\lib\*" lib\ Chris@685: Chris@685: copy "%HGDIR%\windows\system32\msvcm90.dll" . Chris@685: copy "%HGDIR%\windows\system32\msvcp90.dll" . Chris@685: copy "%HGDIR%\windows\system32\msvcr90.dll" . Chris@685: Chris@686: mkdir PyQt5 Chris@692: copy "%PYQTDIR%\__init__.py" PyQt5\__init__.py Chris@692: copy "%PYQTDIR%\Qt.pyd" PyQt5\Qt.pyd Chris@692: copy "%PYQTDIR%\QtCore.pyd" PyQt5\QtCore.pyd Chris@692: copy "%PYQTDIR%\QtGui.pyd" PyQt5\QtGui.pyd Chris@692: copy "%PYQTDIR%\QtWidgets.pyd" PyQt5\QtWidgets.pyd Chris@692: copy "%PYQTDIR%\sip.pyd" PyQt5\sip.pyd Chris@686: Chris@693: mkdir enum Chris@693: copy "%PYPACKAGEDIR%\enum\__init__.py" enum\__init__.py Chris@693: Chris@686: mkdir Crypto Chris@686: mkdir Crypto\Cipher Chris@686: mkdir Crypto\Util Chris@686: Chris@686: copy "%PYCRYPTODIR%\Cipher\__init__.py" Crypto\Cipher\ Chris@686: copy "%PYCRYPTODIR%\Cipher\_AES.pyd" Crypto\Cipher\ Chris@686: copy "%PYCRYPTODIR%\Cipher\AES.py" Crypto\Cipher\ Chris@686: copy "%PYCRYPTODIR%\Cipher\blockalgo.py" Crypto\Cipher\ Chris@686: Chris@686: copy "%PYCRYPTODIR%\Util\__init__.py" Crypto\Util\ Chris@686: copy "%PYCRYPTODIR%\Util\py3compat.py" Crypto\Util\ Chris@686: Chris@686: copy "%PYCRYPTODIR%\__init__.py" Crypto\ Chris@686: Chris@685: if "%ARG%" == "sign" ( Chris@685: @echo Signing components Chris@698: signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 *.dll *.exe Crypto\Cipher\*.pyd PyQt5\*.pyd lib\*.pyd Chris@685: ) Chris@685: Chris@687: set PATH=%PATH%;"C:\Program Files (x86)\WiX Toolset v3.11\bin" Chris@687: Chris@687: del easyhg.msi Chris@687: candle -v ..\..\deploy\win32\easyhg.wxs Chris@687: light -b . -ext WixUIExtension -ext WixUtilExtension -v easyhg.wixobj Chris@697: if %errorlevel% neq 0 exit /b %errorlevel% Chris@687: Chris@697: if "%ARG%" == "sign" ( Chris@697: @echo Signing package Chris@698: signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 easyhg.msi Chris@697: signtool verify /pa easyhg.msi Chris@697: ) Chris@697: