From 013614fca23c6b955a041787943f0ecbf9225bec Mon Sep 17 00:00:00 2001 From: 1mm0rt41PC <5358076+1mm0rt41PC@users.noreply.github.com> Date: Fri, 23 Jun 2023 22:53:25 +0200 Subject: [PATCH] Update build-py.bat --- build-py.bat | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build-py.bat b/build-py.bat index 3af0352..df739ec 100755 --- a/build-py.bat +++ b/build-py.bat @@ -50,12 +50,17 @@ EXIT /B 0 SET _pyExe=%~5 :Build_arch_main CALL log.bat "Building %_outTarget%_%_arch%.exe ..." - IF EXIST %_pyTarget%.py ( - %_pyExe% %PYTHONOPTIMIZE_FLAG% -m PyInstaller --key=%pykey% --icon=%scriptpath%\pytools.ico --onefile %_pyTarget%.py --name %_outTarget%_%_arch% --noupx %hiddenimports% + IF EXIST %_pyTarget%.spec ( + %_pyExe% %PYTHONOPTIMIZE_FLAG% -m PyInstaller %_pyTarget%.spec ) ELSE ( - %_pyExe% %PYTHONOPTIMIZE_FLAG% -m PyInstaller %_pyTarget% %hiddenimports% - copy dist\%_pyTarget:.spec=.exe% dist\%_outTarget%_%_arch%.exe + IF EXIST %_pyTarget%.py ( + %_pyExe% %PYTHONOPTIMIZE_FLAG% -m PyInstaller --key=%pykey% --icon=%scriptpath%\pytools.ico --onefile %_pyTarget%.py --name %_outTarget%_%_arch% --noupx %hiddenimports% + ) ELSE ( + %_pyExe% %PYTHONOPTIMIZE_FLAG% -m PyInstaller %_pyTarget% %hiddenimports% + copy dist\%_pyTarget:.spec=.exe% dist\%_outTarget%_%_arch%.exe + ) ) + IF NOT EXIST "dist\%_outTarget%_%_arch%.exe" CALL log.bat ERR "Build %_outTarget%_%_arch%.exe FAIL" 1 dist\%_outTarget%_%_arch%.exe -h set _err=%ERRORLEVEL%