34 lines
1.1 KiB
Batchfile
34 lines
1.1 KiB
Batchfile
@echo off
|
|
echo Building series3-watcher.exe...
|
|
pip install pyinstaller pystray Pillow
|
|
|
|
REM Extract version from series3_watcher.py (looks for: VERSION = "1.4.2")
|
|
for /f "tokens=3 delims= " %%V in ('findstr /C:"VERSION = " series3_watcher.py') do set RAW_VER=%%V
|
|
set VERSION=%RAW_VER:"=%
|
|
set EXE_NAME=series3-watcher-%VERSION%
|
|
|
|
echo Version: %VERSION%
|
|
echo Output: dist\%EXE_NAME%.exe
|
|
|
|
REM Check whether icon.ico exists alongside this script.
|
|
REM If it does, embed it as the .exe icon AND bundle it as a data file
|
|
REM so the tray overlay can load it at runtime.
|
|
if exist "%~dp0icon.ico" (
|
|
pyinstaller --onefile --windowed --name "%EXE_NAME%" ^
|
|
--icon="%~dp0icon.ico" ^
|
|
--add-data "%~dp0icon.ico;." ^
|
|
series3_tray.py
|
|
) else (
|
|
echo [INFO] icon.ico not found -- building without custom icon.
|
|
pyinstaller --onefile --windowed --name "%EXE_NAME%" series3_tray.py
|
|
)
|
|
|
|
REM Copy versioned exe to plain name for Inno Setup
|
|
copy /Y "dist\%EXE_NAME%.exe" "dist\series3-watcher.exe"
|
|
|
|
echo.
|
|
echo Done.
|
|
echo Gitea upload: dist\%EXE_NAME%.exe
|
|
echo Inno Setup: dist\series3-watcher.exe (copy of above)
|
|
pause
|