@echo off
:: =====================================================
::  DeployPro – IIS Installer
::  Deploys as an IIS web app using iisnode
::  Must be run as Administrator
:: =====================================================

:: Check for administrator privileges
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo.
    echo  ERROR: Administrator privileges required.
    echo  Right-click this file and select "Run as administrator"
    echo.
    pause
    exit /b 1
)

echo.
echo  =====================================================
echo   DeployPro - IIS Installer
echo  =====================================================
echo.

:: Prompt for install directory
set "DEFAULT_DIR=C:\DeployPro"
set /p "INSTALL_DIR=Install directory [%DEFAULT_DIR%]: "
if "%INSTALL_DIR%"=="" set "INSTALL_DIR=%DEFAULT_DIR%"

echo.
echo  Installing to: %INSTALL_DIR%
echo.

:: Run the PowerShell IIS setup script
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0setup-iis.ps1" "%INSTALL_DIR%"

echo.
pause
