-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildwin.bat
31 lines (25 loc) · 1.53 KB
/
buildwin.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@echo off
rem Building the installer requires the following to be installed and added to the path
rem - PyInstaller - https://pyinstaller.org
rem - Inno Setup - https://jrsoftware.org/isinfo.php
rem This runs appdetails.py and captures the output
for /F "tokens=*" %%a in ('python .\app\appdetails.py --name') do SET APPNAME=%%a
for /F "tokens=*" %%a in ('python .\app\appdetails.py --version') do SET APPVERSION=%%a
for /F "tokens=*" %%a in ('python -c "import xmlschema; import os; print(os.path.dirname(xmlschema.__file__))"') do SET XMLSCHEMAPATH=%%a
echo Building installer for %APPNAME% %APPVERSION%
rem Make a copy of xmlschema resourses so they can be included in installer
rem Note that robocopy uses an exit code of 1 to indicate that at least 1 file
rem was copied
set XMLSCHEMACOPY=.\build\xmlschema
if exist %XMLSCHEMACOPY%\ rmdir %XMLSCHEMACOPY% /s /q
robocopy "%XMLSCHEMAPATH%" %XMLSCHEMACOPY% *.xsd /s
if %ERRORLEVEL% NEQ 1 exit /b 1
rem Package up MSYS2 so libcairo can be included in the installer
set MSYS2COPY=.\build\msys64
if exist %MSYS2COPY%\ rmdir %MSYS2COPY% /s /q
python ./scripts/packagemsys2.py %MSYS2COPY%
if %ERRORLEVEL% NEQ 0 exit /b 1
pyinstaller -w autojimmy.py -n %APPNAME% --icon ".\icons\autojimmy.ico" --add-data "data;data" --add-data "icons;icons" --add-data "licenses;licenses" --add-data "%XMLSCHEMACOPY%;xmlschema" --add-data "%MSYS2COPY%;msys64" --clean --noconfirm
if %ERRORLEVEL% NEQ 0 exit /b 1
iscc installer.iss /DApplicationName=%APPNAME% /DApplicationVersion=%APPVERSION%
if %ERRORLEVEL% NEQ 0 exit /b 1