@echo off
setlocal

net session >nul 2>&1
if not "%errorlevel%"=="0" (
    powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%ComSpec%' -ArgumentList '/c ""%~f0"" elevated' -Verb RunAs -Wait"
    exit /b %errorlevel%
)

powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0Install-VST3.ps1"
echo.
echo Close this window.
choice /c X /n /m "Press X to close."
exit /b %errorlevel%
