@echo off
setlocal EnableExtensions
echo Opening Siraya Printer setup UI...
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
  "try { $r=Invoke-WebRequest -Uri 'http://127.0.0.1:5000/health' -UseBasicParsing -TimeoutSec 3; if($r.StatusCode -eq 200){ Start-Process 'http://127.0.0.1:5000'; Write-Host 'OK - opened http://127.0.0.1:5000' } else { throw 'bad status' } } catch { Write-Host 'Printer agent not responding on http://127.0.0.1:5000.'; Write-Host 'Run Repair.cmd as administrator, or check logs:'; Write-Host $env:ProgramData\Siraya\Printer\logs\error.log }"
pause
