@echo off
setlocal
cd /d "%~dp0"

if not exist "%~dp0RicohAutoFSR.exe" (
  echo RicohAutoFSR.exe not found in:
  echo %~dp0
  pause
  exit /b 1
)

echo Browser priority: Chrome ^> Edge ^> Playwright Chromium
py -3.10 "%~dp0ricoh_patched_launcher.py"
set "APP_EXIT=%errorlevel%"

echo.
if %APP_EXIT% neq 0 (
  echo Program exited with error.
  pause
) else (
  echo Program finished.
)
endlocal & exit /b %APP_EXIT%
