Files
Goddess/build.bat
TutorialsGHG b011c7ad75 Initial commit
2026-04-12 21:57:21 +02:00

76 lines
2.5 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
echo.
echo =====================================================
echo NotifyPulse V2 ^| Builder
echo =====================================================
echo.
REM ── 1. Dependencies ─────────────────────────────────────────────────────────
echo [1/4] Installing dependencies...
python -m pip install -r requirements.txt --quiet
if errorlevel 1 (
echo.
echo ERROR: pip install failed. Make sure Python is in your PATH.
pause & exit /b 1
)
echo OK
REM ── 2. Icons ─────────────────────────────────────────────────────────────────
echo.
echo [2/4] Generating icons...
python make_ico.py
if errorlevel 1 (
echo WARNING: Icon generation failed - building without custom icon.
)
REM ── 3. Bundle PWA + UI into dist ──────────────────────────────────────────────
echo.
echo [3/4] Building executable...
REM Collect data files: pwa folder and ui folder
set DATA_ARGS=--add-data "pwa;pwa" --add-data "ui;ui"
if exist icon.ico (
python -m PyInstaller --onefile --noconsole ^
--name NotifyPulse ^
--icon icon.ico ^
%DATA_ARGS% ^
notifier.py
) else (
python -m PyInstaller --onefile --noconsole ^
--name NotifyPulse ^
%DATA_ARGS% ^
notifier.py
)
if errorlevel 1 (
echo.
echo ERROR: Build failed. Check output above.
pause & exit /b 1
)
REM ── 4. Copy assets to dist ────────────────────────────────────────────────────
echo.
echo [4/4] Finalizing dist folder...
if not exist dist\pwa mkdir dist\pwa
if not exist dist\ui mkdir dist\ui
xcopy /E /Y /Q pwa dist\pwa >nul 2>&1
xcopy /E /Y /Q ui dist\ui >nul 2>&1
echo.
echo =====================================================
echo BUILD COMPLETE
echo.
echo Executable : dist\NotifyPulse.exe
echo PWA files : dist\pwa\
echo Web UI : dist\ui\
echo.
echo Run NotifyPulse.exe, then visit:
echo Desktop : http://localhost:5000
echo Mobile : http://^<your-lan-ip^>:5000/pwa
echo =====================================================
echo.
explorer dist
pause