Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/uninstall/HARD-CLEAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ teardown or uninstall: the remaining state may be needed for recovery.
3. **Remove only the approved installed apps.** Use `Remove-AppxPackage -Package
<exact-PackageFullName> -ErrorAction Stop` for the current user, Gateway before
Companion. For Win32, run the reviewed registered uninstaller interactively;
silent Inno uninstall can remove WSL without a separate prompt. Wait for actual
silent Inno uninstall from an earlier release (v2026.11.3 and older, or pre-releases up to v2026.11.12-alpha.1) removes WSL without a prompt. Wait for actual
unregistration, not just launcher exit, since Inno can hand off to a temp
process. Cancellation, timeout, or a remaining registration is not success.
Let Windows remove package data; never manually delete WindowsApps or Packages
Expand Down
7 changes: 5 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,11 @@ Consequences to expect while both are installed:
"Setup has detected that OpenClaw Companion is currently running". Quit the
Store app before installing or uninstalling the Inno build.
- Inno uninstall asks whether to also remove the local WSL gateway. **No** is the
default and keeps it. A silent uninstall (`/SILENT`, `/VERYSILENT`) always
removes the gateway.
default and keeps it. A silent uninstall (`/SILENT`, `/VERYSILENT`), which is what
`winget uninstall` runs by default, also keeps it unless `/RemoveLocalGateway=yes`
is passed. Uninstallers from earlier releases, including v2026.11.3 (which the
current WinGet package runs) and pre-releases up to v2026.11.12-alpha.1, still
remove it silently; uninstall those interactively and choose **No** to keep it.

To make the Store build the one that runs, quit the Inno build and launch the
Store entry, or uninstall the Inno build.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See [choosing a gateway on first launch](https://docs.openclaw.ai/platforms/wind

## Uninstall

Go to **Settings → Apps → Installed apps**, find **OpenClaw Companion**, and click **Uninstall** (or use **Add or Remove Programs** in Control Panel). You'll be asked whether to also remove the local WSL gateway; choose **Yes** to unregister its WSL distro and generated state, or **No** to leave the gateway and that state in place.
Go to **Settings → Apps → Installed apps**, find **OpenClaw Companion**, and click **Uninstall** (or use **Add or Remove Programs** in Control Panel). You'll be asked whether to also remove the local WSL gateway; choose **Yes** to unregister its WSL distro and generated state, or **No** to leave the gateway and that state in place. A silent uninstall, including the default `winget uninstall`, leaves them in place. To remove them unattended, run `unins000.exe /VERYSILENT /NORESTART /RemoveLocalGateway=yes` from the install folder. Uninstallers from earlier releases, including v2026.11.3 (which the current WinGet package runs) and pre-releases up to v2026.11.12-alpha.1, still remove the gateway on a silent uninstall; to keep it with those versions, uninstall interactively and choose **No**.

Your settings file at `%APPDATA%\OpenClawTray\settings.json` is not removed automatically, and device identity files for gateways unrelated to the one you removed are preserved. Choosing **Yes** also removes the removed gateway's own identity directory under `%APPDATA%\OpenClawTray\gateways\`. Root operator and node tokens are preserved only while an external gateway record remains; otherwise they are cleared, even if another local or loopback gateway record remains. Delete `%APPDATA%\OpenClawTray\` manually for a fully clean uninstall. See [docs/SETUP.md](docs/SETUP.md#uninstalling) for details, including the headless `--uninstall --confirm-destructive` CLI path used for testing.

Expand Down
2 changes: 1 addition & 1 deletion docs/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ OpenClaw Companion checks for updates automatically and shows a notification whe

## Uninstalling

Go to **Settings → Apps → Installed apps**, find **OpenClaw Companion**, and click **Uninstall**. Alternatively, use **Add or Remove Programs** in the Control Panel. You'll be asked whether to also remove the local WSL gateway; choose **Yes** to unregister its WSL distro and generated state, or **No** to leave the gateway and that state in place.
Go to **Settings → Apps → Installed apps**, find **OpenClaw Companion**, and click **Uninstall**. Alternatively, use **Add or Remove Programs** in the Control Panel. You'll be asked whether to also remove the local WSL gateway; choose **Yes** to unregister its WSL distro and generated state, or **No** to leave the gateway and that state in place. A silent uninstall (`/SILENT`, `/VERYSILENT`), including the default `winget uninstall`, leaves them in place; to remove them unattended, run `unins000.exe /VERYSILENT /NORESTART /RemoveLocalGateway=yes` from the install folder. Uninstallers from earlier releases, including v2026.11.3 (which the current WinGet package runs) and pre-releases up to v2026.11.12-alpha.1, still remove the gateway on a silent uninstall; to keep it with those versions, uninstall interactively and choose **No**.

Your settings file at `%APPDATA%\OpenClawTray\settings.json` is not removed automatically, and device identity files for gateways unrelated to the one you removed (including per-gateway keys at `%APPDATA%\OpenClawTray\gateways\<gateway-id>\device-key-ed25519.json`) are preserved. Choosing **Yes** also removes the removed gateway's own identity directory. Root operator and node tokens are preserved only while an external gateway record remains; otherwise they are cleared, even if another local or loopback gateway record remains. Delete `%APPDATA%\OpenClawTray\` manually if you want a fully clean uninstall.

Expand Down
10 changes: 8 additions & 2 deletions installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,14 @@ begin

if UninstallSilent() then
begin
LocalGatewayCleanupRequested := True;
Log('Silent uninstall: local gateway cleanup will run automatically.');
// Nobody can answer the dialog below, and package managers uninstall silently by default.
// Removing the WSL gateway is unrecoverable, so an unattended caller has to ask for it.
LocalGatewayCleanupRequested :=
CompareText(ExpandConstant('{param:RemoveLocalGateway|no}'), 'yes') = 0;
if LocalGatewayCleanupRequested then
Log('Silent uninstall: /RemoveLocalGateway=yes requested local gateway cleanup.')
else
Log('Silent uninstall: preserving the {#MyDistroName} WSL distro and generated state. Pass /RemoveLocalGateway=yes to remove them.');
end
else
begin
Expand Down
6 changes: 3 additions & 3 deletions scripts/wipe_openclaw_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
its sandbox account, profile, and listeners; removing the package first
would delete clawctl and the only record of that account.
* Win32 uninstall entries (HKCU/HKLM Uninstall keys), e.g. the Inno
"OpenClaw Companion[ (Dev)]" installer. Inno uninstallers run silently,
which also removes their local WSL gateway. An entry whose uninstaller
"OpenClaw Companion[ (Dev)]" installer. Inno uninstallers run silently; current ones
keep their local WSL gateway, which this script unregisters below. An entry whose uninstaller
file is gone is deleted directly.
- WSL distros OpenClawGateway and OpenClawGateway-Dev (wsl --unregister:
permanently destroys their filesystems). Inventory comes from the HKCU Lxss
Expand Down Expand Up @@ -460,7 +460,7 @@ def uninstall_win32(app: SimpleNamespace) -> bool:
print(f" could not delete {app.where}: {exc}")
return not win32_app_registered(app)
elif is_inno_uninstaller(exe):
cmd = f"{cmd} {INNO_SILENT_ARGS}" # silent Inno uninstall also removes its WSL gateway (installer.iss)
cmd = f"{cmd} {INNO_SILENT_ARGS}" # silent Inno uninstall keeps its WSL gateway; distros are unregistered below
print(f" running uninstaller for {app.name}: {cmd}")
try:
subprocess.run(cmd, shell=True, timeout=UNINSTALL_WAIT_SECONDS)
Expand Down
3 changes: 2 additions & 1 deletion tests/OpenClaw.Tray.Tests/InstallerIssAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public void Installer_RemovesGeneratedAppStateOnlyAfterGatewayCleanup()
Assert.Contains("[Code]", iss);
Assert.Contains("Uninstall-LocalGateway.ps1", iss);
Assert.Contains("UninstallSilent()", iss);
Assert.Contains("LocalGatewayCleanupRequested := True", iss);
Assert.DoesNotContain("LocalGatewayCleanupRequested := True", iss);
Assert.Contains("CompareText(ExpandConstant('{param:RemoveLocalGateway|no}'), 'yes') = 0", iss);
Assert.Contains("{#MyDistroName} WSL distro", iss);
Assert.Contains("MB_YESNO or MB_DEFBUTTON2", iss);
Assert.Contains("ExpandConstant('{sys}\\WindowsPowerShell\\v1.0\\powershell.exe')", iss);
Expand Down
Loading