Skip to content

Add uninstall option to CLI and GUI installers#432

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/uninstall
Mar 5, 2026
Merged

Add uninstall option to CLI and GUI installers#432
erikdarlingdata merged 1 commit into
devfrom
feature/uninstall

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Closes #431. Adds complete uninstall capability to both installers plus a standalone SQL script.

  • install/00_uninstall.sql — standalone script for SSMS users, fully idempotent
  • CLI --uninstall flag — with interactive confirmation prompt
  • GUI Uninstall button — red styled, only enabled when installed version is detected
  • Bug fix: existing clean install path now removes all 3 Agent jobs + both XE sessions (previously missed Hung Job Monitor and XE sessions)

What gets cleaned up

Object Type
PerformanceMonitor - Collection Agent Job
PerformanceMonitor - Data Retention Agent Job
PerformanceMonitor - Hung Job Monitor Agent Job
PerformanceMonitor_BlockedProcess XE Session
PerformanceMonitor_Deadlock XE Session
Server-side trace (LongQueries) Trace
PerformanceMonitor database Database

blocked process threshold (s) is intentionally NOT reset (other tools may depend on it).

Test plan

  • CLI: PerformanceMonitorInstaller.exe <server> <user> <pass> --uninstall
  • CLI: verify all 3 jobs removed, both XE sessions removed, database dropped
  • CLI: run --uninstall a second time (idempotent — no errors)
  • CLI: reinstall after uninstall — clean slate
  • GUI: connect → verify Uninstall button enabled when installed
  • GUI: click Uninstall → confirm dialog → verify removal
  • SSMS: run 00_uninstall.sql directly
  • Verify --reinstall also removes 3rd job + XE sessions (bug fix)

🤖 Generated with Claude Code

Adds complete uninstall capability that removes all server-level objects:
- 3 SQL Agent jobs (Collection, Data Retention, Hung Job Monitor)
- 2 Extended Events sessions (BlockedProcess, Deadlock)
- Server-side traces
- PerformanceMonitor database

Changes:
- New install/00_uninstall.sql standalone script for SSMS users
- CLI: --uninstall flag with interactive confirmation
- GUI: Uninstall button (red, enabled when installed version detected)
- Fix: existing clean install now removes all 3 jobs + XE sessions
  (previously missed Hung Job Monitor and both XE sessions)

blocked process threshold (s) is intentionally NOT reset during uninstall
as other monitoring tools may depend on it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata changed the base branch from main to dev March 5, 2026 00:51
@erikdarlingdata erikdarlingdata merged commit aeecadc into dev Mar 5, 2026
2 of 3 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/uninstall branch April 9, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add uninstall option to CLI and GUI installers

1 participant