@echo off
REM Force SecondVoice to use NVIDIA GPU

echo ========================================
echo SecondVoice - Launcher
echo ========================================
echo.

REM Set NVIDIA GPU preference
set SHIM_MCCOMPAT=0x800000001
set __COMPAT_LAYER=HIGHDPIAWARE

REM Check if .env exists
if not exist "build\mingw-Release\.env" (
    echo [WARNING] .env file not found in build\mingw-Release\
    echo.
    echo Please create it with your API keys:
    echo   OPENAI_API_KEY=sk-...
    echo   ANTHROPIC_API_KEY=sk-ant-...
    echo.
    echo Press any key to continue anyway, or Ctrl+C to cancel
    pause
)

echo Starting SecondVoice...
echo Using NVIDIA GPU (if available)
echo.

cd build\mingw-Release
SecondVoice.exe

if %errorlevel% neq 0 (
    echo.
    echo [ERROR] SecondVoice exited with error code: %errorlevel%
    pause
)

exit /b %errorlevel%
