Skip to content

feat(desktop): add uninstall scripts for macOS, Linux, and Windows#5487

Open
ayobamiseun wants to merge 2 commits into
koala73:mainfrom
ayobamiseun:feat/desktop-uninstall-script
Open

feat(desktop): add uninstall scripts for macOS, Linux, and Windows#5487
ayobamiseun wants to merge 2 commits into
koala73:mainfrom
ayobamiseun:feat/desktop-uninstall-script

Conversation

@ayobamiseun

Copy link
Copy Markdown

Summary

Adds desktop uninstall scripts, closing #5435 ("I'd like to see the uninstall script. Because I can't uninstall it right now.").

  • scripts/uninstall-desktop.sh (macOS / Linux) and scripts/uninstall-desktop.ps1 (Windows), covering all three desktop variants (World / Tech / Finance Monitor). They:
    • stop the running app and its bundled sidecar Node runtime first (mirrors the existing NSIS pre-uninstall hook in src-tauri/nsis/installer-hooks.nsh)
    • remove the app bundle (macOS), the AppImage + integrated launcher .desktop entries (Linux), or run the bundled NSIS/MSI uninstaller found in the registry (Windows)
    • clean up app data, caches, WebView storage, and logs under the app.worldmonitor.desktop / app.worldmonitor.tech.desktop / app.worldmonitor.finance.desktop identifiers (--keep-data to retain)
    • remove OS keychain secrets (service world-monitor: the secrets-vault entry plus the legacy per-key entries from SUPPORTED_SECRET_KEYS), only when uninstalling all variants since the vault is shared (--keep-secrets to retain)
    • list everything found and require confirmation before deleting; both support --dry-run / -DryRun, --yes / -Yes, and --variant / -Variant
  • New "Uninstall" section in docs/desktop-app.mdx with the script usage and manual per-platform removal steps.

Type of change

  • New feature
  • Documentation

Affected areas

  • Desktop app (Tauri)
  • Other: scripts/

Checklist

  • Tested on worldmonitor.app variant — N/A (no web-app changes)
  • Tested on tech.worldmonitor.app variant (if applicable) — N/A
  • New RSS feed domains added to api/rss-proxy.js allowlist (if adding feeds) — N/A
  • No API keys or secrets committed
  • TypeScript compiles without errors (npm run typecheck) — no TS changes; docs:check and lint:unicode pass

Documentation Alignment Checklist

N/A — no methodology, API/MCP contract, or generated-doc claims changed.

Testing done

  • bash -n syntax check; --help, --dry-run, --variant tech, and invalid-variant paths exercised
  • End-to-end against a faked $HOME on macOS: planted World Monitor.app, Tech Monitor.app, and the Application Support / Caches / Logs / WebKit / Preferences artifacts — dry-run listed exactly those paths, the real run removed them all, and --keep-data preserved the data dirs while removing the app bundle
  • Keychain removal is only offered when a world-monitor keychain entry actually exists, so a machine with no install exits with "Nothing to uninstall"
  • The empty-array expansion is guarded for bash 3.2 (macOS default shell)
  • Not tested: the PowerShell script on a real Windows machine (no Windows box available) — it parses the same registry DisplayName entries Tauri's NSIS/MSI bundlers write, but a smoke test on Windows before merge would be prudent

Adds scripts/uninstall-desktop.sh (macOS/Linux) and
scripts/uninstall-desktop.ps1 (Windows) that remove the desktop app for
all three variants (World/Tech/Finance Monitor), including:

- the app bundle (macOS), AppImage + desktop entries (Linux), or the
  bundled NSIS/MSI uninstaller (Windows)
- app data, caches, WebView storage, and logs (--keep-data to retain)
- the OS keychain secrets vault, service "world-monitor", including
  legacy per-key entries (--keep-secrets to retain; only removed when
  uninstalling all variants since the vault is shared)

Both scripts stop the running app and bundled sidecar Node runtime
first (mirroring the NSIS pre-uninstall hook), list everything found,
and require confirmation (--dry-run / --yes supported).

Documents uninstall steps (script + manual) in docs/desktop-app.mdx.

Closes koala73#5435
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@ayobamiseun is attempting to deploy a commit to the World Monitor Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the trust:caution Brin: contributor trust score caution label Jul 23, 2026
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds cross-platform desktop uninstall tooling and documentation.

  • Adds macOS/Linux removal, data cleanup, process shutdown, and keychain cleanup in a Bash script.
  • Adds Windows installer discovery, process shutdown, data cleanup, and Credential Manager cleanup in PowerShell.
  • Documents scripted and manual uninstall procedures for all desktop variants.

Confidence Score: 3/5

The PR should not merge until variant-specific sidecar shutdown is scoped correctly and the macOS sidecar path is fixed.

Linux and Windows uninstalls can terminate another installed variant's runtime, while the malformed macOS path leaves the selected variant's sidecar running after its bundle is removed.

scripts/uninstall-desktop.sh, scripts/uninstall-desktop.ps1

Important Files Changed

Filename Overview
scripts/uninstall-desktop.sh Adds macOS/Linux uninstall handling, but sidecar shutdown is overbroad on Linux and uses an incorrect bundle path on macOS.
scripts/uninstall-desktop.ps1 Adds Windows uninstaller and cleanup orchestration, but variant-specific runs terminate sidecars belonging to other variants.
docs/desktop-app.mdx Documents the new scripts, options, shared-secret behavior, and manual removal procedures.

Reviews (1): Last reviewed commit: "feat(desktop): add uninstall scripts for..." | Re-trigger Greptile

Comment thread scripts/uninstall-desktop.sh Outdated
if [ "$OS" = "Darwin" ]; then
pkill -f "${product}.app/Contents/Resources/resources/sidecar" 2>/dev/null || true
else
pkill -f "resources/sidecar/node" 2>/dev/null || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Variant-agnostic sidecar termination

When one Linux variant is uninstalled while another variant is running, this common path substring matches and terminates every bundled sidecar, causing the retained application to abruptly lose its local API runtime. The equivalent ExecutablePath match in the PowerShell script has the same cross-variant behavior on Windows.

Knowledge Base Used: Desktop Tauri Shell

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f20ab6a — the macOS orphan fallback now matches any sidecar path under the variant bundle's Contents/Resources/ (layout-agnostic, product-scoped) instead of the incorrect Resources/resources/sidecar path. Live (non-orphaned) sidecars are caught earlier by the new parent-process match, which doesn't depend on the packaged layout at all.

Comment thread scripts/uninstall-desktop.sh Outdated
# it spawned (matches the NSIS pre-uninstall hook behavior on Windows).
pkill -x "$binary" 2>/dev/null || true
if [ "$OS" = "Darwin" ]; then
pkill -f "${product}.app/Contents/Resources/resources/sidecar" 2>/dev/null || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Incorrect macOS sidecar path

When a macOS variant is uninstalled while its sidecar is running, this pattern looks for Contents/Resources/resources/sidecar instead of the packaged Contents/Resources/sidecar path, leaving the local server running after its application bundle is removed.

Knowledge Base Used: Desktop Tauri Shell

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f20ab6a — live sidecars are now matched by parent process (the variant binary that spawned them) instead of a shared path substring, so uninstalling one variant no longer terminates another variant's sidecar. Verified with a live process tree: killing the world variant's sidecar left a running tech-monitor's sidecar untouched.

@rajpratham1 rajpratham1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request adds comprehensive uninstall support across macOS, Linux, and Windows, including cleanup of application data and keychain/credential storage, along with thorough user documentation. However, two blocking issues remain. On macOS, the sidecar termination pattern references an incorrect packaged path (Contents/Resources/resources/sidecar), which may fail to stop the running sidecar before the application bundle is removed. Additionally, the Linux process termination pattern is variant-agnostic and can terminate the sidecar for other installed variants that the user did not choose to uninstall. The PowerShell implementation appears to have the same cross-variant behavior. These process-matching patterns should be made variant-specific before merging.

Review follow-up on the two P1s:

- The Linux sidecar kill matched the shared path substring
  resources/sidecar/node, so uninstalling one variant terminated every
  variant's running sidecar. Live sidecars are now matched by parent
  process (the sidecar is spawned by the variant binary), which is
  variant-scoped and platform-independent.
- The macOS orphan fallback looked under Contents/Resources/resources/
  sidecar, which does not match the packaged layout. It now matches any
  sidecar path under the variant bundle's Contents/Resources/, scoped by
  product name; the Linux orphan fallback matches the variant's AppImage
  FUSE mount prefix instead of the shared substring.

Verified with a live process tree (world-monitor and tech-monitor
parents each owning a sidecar/node child): killing the world variant's
sidecar leaves the tech variant's sidecar running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trust:caution Brin: contributor trust score caution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants