@echo off
rem Soundka portable launcher. Elevates itself once, then registers the APO
rem and starts the local control service. See the instructions .txt next to
rem this file. The "elevated" argument stops a failed elevation from looping.
setlocal
if "%~1"=="elevated" goto run
rem fltmc needs administrator rights and, unlike "net session", does not depend
rem on the Server service being enabled.
fltmc >nul 2>&1
if not errorlevel 1 goto run
echo Requesting administrator rights...
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -ArgumentList 'elevated' -Verb RunAs"
exit /b 0

:run
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\run_dev_stack.ps1"
echo.
echo The control service has stopped. Run the stop script to remove the stack.
pause
