@echo off
echo ============================================
echo   Warexya Print Agent - Desinstalador
echo ============================================
echo.

net session >nul 2>&1
if errorlevel 1 (
    echo ERROR: Ejecuta como Administrador.
    pause
    exit /b 1
)

set SERVICE_NAME=WarexyaPrintAgent
set INSTALL_DIR=%ProgramFiles%\Warexya\PrintAgent

echo [1/3] Deteniendo servicio...
sc stop %SERVICE_NAME% >nul 2>&1
timeout /t 3 /nobreak >nul

echo [2/3] Eliminando servicio...
sc delete %SERVICE_NAME%

echo [3/3] Eliminando archivos...
if exist "%INSTALL_DIR%" rmdir /S /Q "%INSTALL_DIR%"

echo.
echo === Desinstalacion completada ===
pause
