Class_generator/START_PORTABLE.bat
StillHammer ab84bbbc71 Reduce game sizes and fix Mario level display
- Reduce RiverRun game height from 100vh to 75vh for better screen fit
- Reduce AdventureReader game height from 100vh to 75vh
- Fix Mario level number display (was showing currentLevel + 1 twice)
  - Updated HUD level display in Renderer.js
  - Updated finish line flag level display in Renderer.js
- Add portable setup files and documentation
- Add new game modules: SentenceInvaders, ThematicQuestions
- Add new content: wte2 book, sbs chapters 2-3, wte2-2 chapter
- Update various game modules for improved compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-18 16:22:33 +08:00

86 lines
2.1 KiB
Batchfile

@echo off
title Class Generator - Portable Edition
cd /d "%~dp0"
echo.
echo ========================================
echo Class Generator - Portable Edition
echo ========================================
echo.
:: Check if portable Node.js exists
if not exist "nodejs-portable\node.exe" (
echo [ERROR] Node.js portable not found!
echo.
echo Please follow the setup instructions in PORTABLE_SETUP.txt
echo.
pause
exit /b 1
)
:: Add portable Node.js to PATH for this session only
set PATH=%~dp0nodejs-portable;%PATH%
:: Verify Node.js is working
echo [1/3] Checking Node.js...
"%~dp0nodejs-portable\node.exe" --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Node.js is not working properly
pause
exit /b 1
)
echo Node.js OK!
:: Check if node_modules exists
echo [2/3] Checking dependencies...
if not exist "node_modules" (
echo Installing dependencies...
"%~dp0nodejs-portable\node.exe" "%~dp0nodejs-portable\node_modules\npm\bin\npm-cli.js" install
) else (
echo Dependencies OK!
)
:: Kill any existing servers on port 8080
echo [3/4] Cleaning up old servers...
taskkill /f /im node.exe >nul 2>&1
timeout /t 1 /nobreak >nul
:: Start the server in background
echo [4/4] Starting server...
echo.
echo ========================================
echo Server starting on http://localhost:8080
echo Opening browser automatically...
echo Press Ctrl+C to stop
echo ========================================
echo.
:: Start server in background
start /b "" "%~dp0nodejs-portable\node.exe" server.js
:: Wait for server to start
timeout /t 2 /nobreak >nul
:: Try to open Firefox, fallback to default browser
echo Opening browser...
start firefox http://localhost:8080 >nul 2>&1
if %errorlevel% neq 0 (
echo Firefox not found, opening default browser...
start http://localhost:8080
)
echo.
echo Browser opened! Server is running in background.
echo Press any key to STOP the server and close...
pause >nul
:: Stop the server
echo.
echo Stopping server...
taskkill /f /im node.exe >nul 2>&1
:: If we get here, the server stopped
echo.
echo Server stopped
pause