You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.0 KiB
Batchfile

@echo off
chcp 65001 >nul
setlocal EnableDelayedExpansion
cd /d "%~dp0"
echo ITD Transport - building portable EXE
echo.
python -c "import PyInstaller" >nul 2>nul
if errorlevel 1 (
echo PyInstaller not found. Install: pip install pyinstaller
pause
exit /b 1
)
if not exist "main.py" (
echo Error: main.py not found in current folder.
pause
exit /b 1
)
python -m PyInstaller --onefile -w --name "ITD_Transport" ^
--icon "ITD.ico" ^
--add-data "schema.sql;." ^
--hidden-import=pyodbc ^
--hidden-import=qrcode ^
--hidden-import=PIL ^
--hidden-import=PIL.Image ^
--hidden-import=PIL.ImageTk ^
--hidden-import=itd_db ^
--hidden-import=db_check ^
--hidden-import=centered_messagebox ^
main.py
if errorlevel 1 (
echo.
echo Build failed.
pause
exit /b 1
)
echo.
echo Done. EXE: dist\ITD_Transport.exe
echo.
echo For portable use: copy dist\ITD_Transport.exe, appsettings.json and ITD.ico
echo to a folder on the target machine.
echo.
pause
exit /b 0