Files
thor-watcher/build.bat
2026-03-20 17:34:51 -04:00

32 lines
999 B
Batchfile

@echo off
echo Building thor-watcher.exe...
pip install pyinstaller pystray Pillow
REM Extract version from series4_ingest.py (looks for: VERSION = "0.2.0")
for /f "tokens=3 delims= " %%V in ('findstr /C:"VERSION = " series4_ingest.py') do set RAW_VER=%%V
set VERSION=%RAW_VER:"=%
set EXE_NAME=thor-watcher-%VERSION%
echo Version: %VERSION%
echo Output: dist\%EXE_NAME%.exe
REM Check whether icon.ico exists alongside this script.
if exist "%~dp0icon.ico" (
pyinstaller --onefile --windowed --name "%EXE_NAME%" ^
--icon="%~dp0icon.ico" ^
--add-data "%~dp0icon.ico;." ^
thor_tray.py
) else (
echo [INFO] icon.ico not found -- building without custom icon.
pyinstaller --onefile --windowed --name "%EXE_NAME%" thor_tray.py
)
REM Copy versioned exe to plain name for Inno Setup
copy /Y "dist\%EXE_NAME%.exe" "dist\thor-watcher.exe"
echo.
echo Done.
echo Gitea upload: dist\%EXE_NAME%.exe
echo Inno Setup: dist\thor-watcher.exe (copy of above)
pause