@echo off
setlocal

set "INSTALL_DIR=%ProgramFiles%\Tisailan"

net session >nul 2>&1
if %errorlevel% neq 0 (
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit /b
)

echo Removendo o servico Tisailan Agent...
if exist "%INSTALL_DIR%\tisailan-agent.exe" (
    "%INSTALL_DIR%\tisailan-agent.exe" uninstall-service
)

echo Servico removido. Os arquivos em "%INSTALL_DIR%" podem ser apagados manualmente.
pause
