@echo off
setlocal

if not exist "%~dp0Install-Standalone.ps1" (
    echo Cannot find Install-Standalone.ps1 next to this script.
    echo Extract the whole ZIP archive first, then run this installer from the extracted folder.
    pause
    exit /b 1
)

if not exist "%~dp0Pioneer AD Sampler.exe" (
    echo Cannot find Pioneer AD Sampler.exe next to this script.
    echo Extract the whole ZIP archive first, then run this installer from the extracted folder.
    pause
    exit /b 1
)

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