@echo off
setlocal

set "SCRIPT_DIR=%~dp0"
set "INSTALL_PS1=%SCRIPT_DIR%lib\install.ps1"

if not exist "%INSTALL_PS1%" (
    echo ERROR: install script not found: "%INSTALL_PS1%"
    exit /b 1
)

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0lib\install.ps1"
set "EXIT_CODE=%ERRORLEVEL%"

if not "%EXIT_CODE%"=="0" (
    echo ERROR: install failed with exit code %EXIT_CODE%.
    exit /b %EXIT_CODE%
)

exit /b 0
