@echo off REM ============================================================ REM Kiwy Signage Player - Watchdog Launcher (Windows) REM ============================================================ REM Starts watchdog.ps1, which keeps the player running 24/7: REM * restarts it if it crashes REM * restarts it if it hangs (stale heartbeat) REM * backs off if it cannot stay up (crash-loop breaker) REM REM The WATCHDOG runs in this window. Closing it stops supervision REM (it does NOT stop the player). REM REM The ONLY supported way to stop the player is the exit screen REM password. That writes .player_stop_requested next to the .exe, REM which tells the watchdog not to restart it. Launching again REM starts a fresh session and clears that flag. REM REM Usage: REM start_player_watchdog.bat start supervising REM start_player_watchdog.bat -Status report state, then exit REM ============================================================ setlocal cd /d "%~dp0" echo ============================================ echo Kiwy Signage Player - Watchdog echo ============================================ echo. echo Stop the WATCHDOG with Ctrl+C. echo Stop the PLAYER via the exit password. echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0watchdog.ps1" %* set "RC=%ERRORLEVEL%" if not "%RC%"=="0" ( echo. echo [ERROR] Watchdog exited with code %RC%. echo Check logs\watchdog.log next to the player executable. echo. ) REM Keep the window open so a crash is readable when double-clicked. if "%~1"=="" pause endlocal exit /b %RC%