@echo off
REM ShopfloorConnect Installer Launcher
REM This batch file runs the ShopfloorConnect installer with admin privileges

echo ========================================
echo ShopfloorConnect MTC Service Installer
echo ========================================
echo.
echo This will install the ShopfloorConnect MTC Service.
echo.
echo Requirements:
echo   - Administrator privileges
echo   - Windows 7 or newer
echo   - Approximately 200MB disk space
echo.
pause

REM Check if running as administrator
net session >nul 2>&1
if %errorLevel% == 0 (
    echo Running as Administrator... OK
    echo.
) else (
    echo ERROR: This script must be run as Administrator!
    echo.
    echo Please right-click this file and select "Run as administrator"
    echo.
    pause
    exit /b 1
)

REM Check if installer exists
if not exist "%~dp0ShopfloorConnect_Installer.exe" (
    echo ERROR: ShopfloorConnect_Installer.exe not found!
    echo.
    echo Please ensure the installer is in the same folder as this batch file.
    echo Current location: %~dp0
    echo.
    pause
    exit /b 1
)

REM Run the installer
echo Starting installer...
echo.
"%~dp0ShopfloorConnect_Installer.exe"

REM Check exit code
if %errorLevel% == 0 (
    echo.
    echo Installation completed successfully.
) else (
    echo.
    echo Installation failed or was cancelled.
    echo Exit code: %errorLevel%
)

echo.
pause
