@echo off
chcp 65001 >nul
title NA Overlay - install
set "NA=%LOCALAPPDATA%\NAOverlay"
if not exist "%NA%" mkdir "%NA%"
echo [1/3] Downloading installer script...
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-WebRequest 'https://na-overlay.vercel.app/na-overlay-install.ps1?t=%RANDOM%' -OutFile '%NA%\na-overlay-install.ps1' -UseBasicParsing; exit 0 } catch { Write-Host ('DOWNLOAD FAILED: ' + $_.Exception.Message) -ForegroundColor Red; exit 1 }"
if errorlevel 1 goto :fail
echo [2/3] Installing...
powershell -NoProfile -ExecutionPolicy Bypass -File "%NA%\na-overlay-install.ps1"
if errorlevel 1 goto :fail
echo.
echo [3/3] DONE - follow the steps above (open chrome://extensions, Load unpacked, paste path with Ctrl+V).
echo Folder: %NA%\ext
pause
exit /b 0
:fail
echo.
echo *** INSTALL FAILED *** Take a screenshot of this window and send it to the admin.
echo Manual option: download https://na-overlay.vercel.app/na-overlay-unpacked.zip and Load unpacked in Chrome.
pause
exit /b 1
