elastic / elastic/docs-content

Document MSI-specific uninstall procedure for Elastic Agent on Windows

Open Beginner friendly
#7,927 2 comments 0 reactions 0 assignees View on GitHub
Team:SKI
Dominant language
No language data
Stars
47
Forks
261
Avg merge
3d 12h
Merged PRs (30d)
116

Description

## Summary

The page \"Install Elastic Agent from an MSI package\"
(https://www.elastic.co/docs/reference/fleet/install-agent-msi) has no
uninstall section, and the general \"Uninstall Elastic Agents from edge hosts\"
page (https://www.elastic.co/docs/reference/fleet/uninstall-elastic-agent)
covers only the `elastic-agent.exe uninstall` method. Neither page mentions:

- That `msiexec /x` is the correct uninstall method for MSI-installed agents
- The correct `INSTALLARGS` usage during uninstall (e.g. `INSTALLARGS="--uninstall-token="` for tamper-protected agents)
- That reusing install-time `INSTALLARGS` (which include `--url` and `--enrollment-token`) at uninstall time causes the uninstall to fail with error code 1603, because `elastic-agent uninstall` does not accept those flags

The correct syntax exists in the elastic-stack-installers GitHub README but is not surfaced at elastic.co/docs.

**Why this needs docs:** Users who install via MSI from the Fleet UI naturally expect to uninstall via MSI with the same command structure. Without documentation they either fail with a cryptic 1603 error or don't know `msiexec /x` is an option.

## What should be added

Add an "Uninstalling" section to the MSI install page:

```powershell
# Without tamper protection
msiexec /x elastic-agent--windows-x86_64.msi /qn /norestart

# With tamper protection enabled
msiexec /x elastic-agent--windows-x86_64.msi INSTALLARGS="--uninstall-token=" /qn /norestart
```

With a note that install-time `INSTALLARGS` values (`--url`, `--enrollment-token`) must **not** be passed at uninstall time — they are install-only flags and will cause the MSI custom action to fail with error code 1603.

Also add a cross-reference or short note on the general uninstall page pointing MSI-installed Windows users to the MSI-specific instructions.

## Suggested next steps

- Add "Uninstalling" section to `/docs/reference/fleet/install-agent-msi`
- Add cross-reference in `/docs/reference/fleet/uninstall-elastic-agent` for MSI-installed agents
- Verify exact `INSTALLARGS` token format against elastic-stack-installers source at draft time

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with /docs/reference/fleet/install-agent-msi and /docs/reference/fleet/uninstall-elastic-agent, then verify the exact INSTALLARGS token format against the elastic-stack-installers README. Done means both pages explain msiexec /x, the tamper-protection token, and why install-time flags cause error 1603, with a cross-reference for MSI-installed Windows agents.

Written by the indexing model from the issue text.

Assessment

Domain
devops, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.