@echo off setlocal enabledelayedexpansion REM ===================================================================== REM PQS on-demand launcher for XAMPP Lite 8.5 REM Copy this file to the XAMPP Lite root (next to XL-Control-Panel.x64.exe) REM and run it. It starts MariaDB + Apache and provisions the pqs database REM on first run. The app must already be deployed to www\pqs . REM ===================================================================== set "ROOT=%~dp0" if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%" set "MYSQLBIN=%ROOT%\apps\mysql\bin" set "APACHEBIN=%ROOT%\apps\apache\bin" set "APP=%ROOT%\www\pqs" if not exist "%MYSQLBIN%\mysqld.exe" ( echo [PQS] ERROR: run this from the XAMPP Lite root ^(apps\ not found next to it^). goto :end ) REM Apache reads these two placeholders from the environment (forward slashes). set "XAMPP_LITE_ROOT=%ROOT:\=/%" set "SRVROOT=%XAMPP_LITE_ROOT%/apps/apache" echo [PQS] Starting MariaDB... start "" /B "%MYSQLBIN%\mysqld.exe" --defaults-file="%MYSQLBIN%\my.ini" --datadir="%ROOT%\apps\mysql\data" echo [PQS] Waiting for MariaDB... set /a TRIES=0 :waitdb "%MYSQLBIN%\mysql.exe" -u root -h 127.0.0.1 -e "SELECT 1" >nul 2>&1 if not errorlevel 1 goto dbready set /a TRIES+=1 if !TRIES! GEQ 30 ( echo [PQS] ERROR: MariaDB did not come up. & goto :end ) ping -n 2 127.0.0.1 >nul goto waitdb :dbready echo [PQS] MariaDB is up. "%MYSQLBIN%\mysql.exe" -u root -h 127.0.0.1 -e "USE pqs" >nul 2>&1 if errorlevel 1 ( echo [PQS] Provisioning pqs database from installer... "%MYSQLBIN%\mysql.exe" -u root -h 127.0.0.1 < "%APP%\install\pqs_install.sql" ) else ( echo [PQS] pqs database already present; skipping provisioning. ) echo [PQS] Starting Apache... start "" /B "%APACHEBIN%\httpd.exe" -f "%ROOT%\apps\apache\conf\httpd.conf" echo. echo [PQS] Ready. echo Kiosk : http://localhost/pqs/callsign.php echo Ops : http://localhost/pqs/console.php echo Wall : http://localhost/pqs/combinedqueue.php echo Stop : taskkill /IM httpd.exe /F ^&^& taskkill /IM mysqld.exe /F :end endlocal