@echo off
:: Professional elevating launcher for Ethernet Bridge Connector setup.
:: Double-click this file. It requests Administrator rights, then runs Install.ps1.
setlocal
cd /d "%~dp0"

net session >nul 2>&1
if %errorLevel% equ 0 goto :run

echo Requesting administrator permission...
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
  "Start-Process -FilePath '%~f0' -Verb RunAs"
exit /b

:run
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0Install.ps1"
set ERR=%ERRORLEVEL%
if %ERR% neq 0 (
  echo.
  echo Setup finished with errors. Code: %ERR%
  pause
)
exit /b %ERR%
