uninstall-service.bat 619 B

12345678910111213141516171819202122
  1. @echo off
  2. REM Stop and deregister the Bambuddy Windows service.
  3. REM
  4. REM Called from Inno Setup's [UninstallRun] section. Argument:
  5. REM %1 = install dir (e.g. C:\Program Files\Bambuddy)
  6. setlocal
  7. set "INSTALL_DIR=%~1"
  8. set "NSSM=%INSTALL_DIR%\bin\nssm.exe"
  9. REM Stop is best-effort — if the service is already stopped, NSSM
  10. REM returns non-zero and we want to proceed to the remove step.
  11. "%NSSM%" stop Bambuddy 2>nul
  12. REM Remove the service registration. confirm flag skips the
  13. REM interactive prompt.
  14. "%NSSM%" remove Bambuddy confirm 2>nul
  15. echo [uninstall-service] Bambuddy service deregistered
  16. endlocal
  17. exit /b 0