@echo off
setlocal
cd /d "%~dp0"

if not exist "runtime\node.exe" (
    echo The bundled runtime is missing. Re-extract the complete package.
    pause
    exit /b 1
)

if not exist "web\dist\index.html" (
    echo The built application files are missing. Re-extract the complete package.
    pause
    exit /b 1
)

echo Starting Infinite Canvas...
echo The browser will open after the local server is ready.
echo Keep this window open while using Infinite Canvas.
echo.
"runtime\node.exe" "run-infinite-canvas.mjs"

echo.
echo Infinite Canvas stopped.
pause
