annotate deploy/win32/build-and-package.bat @ 692:a74515f1c6e8

Inching forward with win32 packaging
author Chris Cannam
date Mon, 10 Dec 2018 14:45:17 +0000
parents 1add6167eb3c
children b939bdac0643
rev   line source
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@685 13 if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.15.26706\x64\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@685 30 set CRTDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.15.26706\x64\Microsoft.VC141.CRT
Chris@686 31 set PYQTDIR=C:/Python27/Lib/site-packages/PyQt5/
Chris@686 32 set PYCRYPTODIR=C:/Python27/Lib/site-packages/Crypto/
Chris@685 33 set NAME=Open Source Developer, Christopher Cannam
Chris@685 34
Chris@685 35 set ARG=%1
Chris@685 36 shift
Chris@685 37 if "%ARG%" == "sign" (
Chris@685 38 @ echo NOTE: sign option specified, will attempt to codesign exe and msi
Chris@685 39 ) else (
Chris@685 40 @ echo NOTE: sign option not specified, will not codesign anything
Chris@685 41 )
Chris@685 42
Chris@685 43 cd %STARTPWD%
Chris@685 44 rem del /q /s build_win32
Chris@685 45 call .\deploy\win32\build.bat
Chris@685 46 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@685 47
Chris@685 48 if not exist mercurial-4.8.0-x86.msi (
Chris@685 49 C:\ProgramData\chocolatey\bin\wget https://bitbucket.org/tortoisehg/files/downloads/mercurial-4.8.0-x86.msi
Chris@685 50 )
Chris@685 51 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@685 52
Chris@685 53 if not exist mercurial-4.8.0-x86 (
Chris@685 54 msiexec /a mercurial-4.8.0-x86.msi /qn TARGETDIR=%STARTPWD%\mercurial-4.8.0-x86
Chris@685 55 )
Chris@685 56 if %errorlevel% neq 0 exit /b %errorlevel%
Chris@685 57
Chris@685 58 set HGDIR=%STARTPWD%\mercurial-4.8.0-x86
Chris@685 59
Chris@685 60 cd build_win32\release
Chris@685 61
Chris@686 62 copy "%STARTPWD%\easyhg.py" .
Chris@686 63
Chris@685 64 copy "%CRTDIR%\concrt140.DLL" .
Chris@685 65 copy "%CRTDIR%\msvcp140.DLL" .
Chris@685 66 copy "%CRTDIR%\vccorlib140.DLL" .
Chris@685 67 copy "%CRTDIR%\vcruntime140.DLL" .
Chris@685 68
Chris@685 69 copy "%HGDIR%\PFiles\Mercurial\hg.exe" .
Chris@685 70 copy "%HGDIR%\PFiles\Mercurial\python27.dll" .
Chris@685 71
Chris@685 72 mkdir lib
Chris@686 73 copy "%HGDIR%\PFiles\Mercurial\lib\*" lib\
Chris@685 74
Chris@685 75 copy "%HGDIR%\windows\system32\msvcm90.dll" .
Chris@685 76 copy "%HGDIR%\windows\system32\msvcp90.dll" .
Chris@685 77 copy "%HGDIR%\windows\system32\msvcr90.dll" .
Chris@685 78
Chris@686 79 mkdir PyQt5
Chris@692 80 copy "%PYQTDIR%\__init__.py" PyQt5\__init__.py
Chris@692 81 copy "%PYQTDIR%\Qt.pyd" PyQt5\Qt.pyd
Chris@692 82 copy "%PYQTDIR%\QtCore.pyd" PyQt5\QtCore.pyd
Chris@692 83 copy "%PYQTDIR%\QtGui.pyd" PyQt5\QtGui.pyd
Chris@692 84 copy "%PYQTDIR%\QtWidgets.pyd" PyQt5\QtWidgets.pyd
Chris@692 85 copy "%PYQTDIR%\sip.pyd" PyQt5\sip.pyd
Chris@686 86
Chris@686 87 mkdir Crypto
Chris@686 88 mkdir Crypto\Cipher
Chris@686 89 mkdir Crypto\Util
Chris@686 90
Chris@686 91 copy "%PYCRYPTODIR%\Cipher\__init__.py" Crypto\Cipher\
Chris@686 92 copy "%PYCRYPTODIR%\Cipher\_AES.pyd" Crypto\Cipher\
Chris@686 93 copy "%PYCRYPTODIR%\Cipher\AES.py" Crypto\Cipher\
Chris@686 94 copy "%PYCRYPTODIR%\Cipher\blockalgo.py" Crypto\Cipher\
Chris@686 95
Chris@686 96 copy "%PYCRYPTODIR%\Util\__init__.py" Crypto\Util\
Chris@686 97 copy "%PYCRYPTODIR%\Util\py3compat.py" Crypto\Util\
Chris@686 98
Chris@686 99 copy "%PYCRYPTODIR%\__init__.py" Crypto\
Chris@686 100
Chris@685 101 if "%ARG%" == "sign" (
Chris@685 102 @echo Signing components
Chris@685 103 signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 *.dll *.exe lib\*
Chris@685 104 signtool verify /pa sonic-visualiser.msi
Chris@687 105 rem AND MORE
Chris@685 106 )
Chris@685 107
Chris@687 108 set PATH=%PATH%;"C:\Program Files (x86)\WiX Toolset v3.11\bin"
Chris@687 109
Chris@687 110 del easyhg.msi
Chris@687 111 candle -v ..\..\deploy\win32\easyhg.wxs
Chris@687 112 light -b . -ext WixUIExtension -ext WixUtilExtension -v easyhg.wixobj
Chris@687 113
Chris@685 114 rem Todo: the rest