@echo off
setlocal

if not exist "%~dp0Install-Bundle.ps1" (
    echo Cannot find Install-Bundle.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 "%~dp0Plugins\Pioneer MP Trigger.vst3" (
    echo Cannot find Plugins\Pioneer MP Trigger.vst3 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 "%~dp0Standalone\Pioneer AD Sampler.exe" (
    echo Cannot find Standalone\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-Bundle.ps1"
echo.
echo Close this window.
choice /c X /n /m "Press X to close."
exit /b %errorlevel%
