2021-07-16 09:37:22 -07:00
|
|
|
@echo off
|
2021-07-13 23:25:37 -07:00
|
|
|
|
2021-07-16 09:37:22 -07:00
|
|
|
set compileUI=0
|
|
|
|
set build=0
|
2021-07-13 23:25:37 -07:00
|
|
|
|
2021-08-04 16:22:15 -07:00
|
|
|
IF "%~1" == "" (
|
|
|
|
echo --------------
|
|
|
|
echo BUILD SCRIPT
|
|
|
|
echo --------------
|
|
|
|
echo -compileUI Generate main window class from .UI file
|
|
|
|
echo -build Build standalone desktop app with embedded python runtime
|
|
|
|
exit
|
|
|
|
)
|
|
|
|
|
2021-07-16 09:37:22 -07:00
|
|
|
FOR %%A IN (%*) DO (
|
|
|
|
IF "%%A"=="-compileUI" set compileUI=1
|
|
|
|
IF "%%A"=="-build" set build=1
|
|
|
|
)
|
2021-07-13 23:25:37 -07:00
|
|
|
|
2021-08-04 16:22:15 -07:00
|
|
|
if %compileUI%==1 (
|
|
|
|
pyuic5.exe -x .\ui\mainwin.ui -o mainwin.py
|
|
|
|
if %ERRORLEVEL% EQU 0 echo Generated mainwin.py.
|
|
|
|
if %ERRORLEVEL% EQU 1 echo Generation failed.
|
|
|
|
)
|
2021-07-13 23:25:37 -07:00
|
|
|
|
2021-07-16 09:37:22 -07:00
|
|
|
if %build%==1 pyinstaller --onefile --windowed --icon=favicon.ico app.py
|
|
|
|
|
2021-08-04 16:22:15 -07:00
|
|
|
exit
|