@echo off
setlocal
set "PS1=%TEMP%\A2Agent-RentTokens-Windows.ps1"
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -UseBasicParsing 'https://a2agent.io/worker/A2Agent-RentTokens-Windows.ps1' -OutFile '%PS1%'"
if errorlevel 1 (
  echo Failed to download the A2Agent Windows installer.
  pause
  exit /b 1
)
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Command setup -Provider both
if errorlevel 1 (
  echo.
  echo A2Agent setup failed. Review the output above.
  pause
  exit /b 1
)
echo.
echo A2Agent Rent Tokens setup complete.
pause
