feat(desktop): add uninstall scripts for macOS, Linux, and Windows#5487
feat(desktop): add uninstall scripts for macOS, Linux, and Windows#5487ayobamiseun wants to merge 2 commits into
Conversation
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
|
@ayobamiseun is attempting to deploy a commit to the World Monitor Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryAdds cross-platform desktop uninstall tooling and documentation.
Confidence Score: 3/5The 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
Reviews (1): Last reviewed commit: "feat(desktop): add uninstall scripts for..." | Re-trigger Greptile |
| 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
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) andscripts/uninstall-desktop.ps1(Windows), covering all three desktop variants (World / Tech / Finance Monitor). They:src-tauri/nsis/installer-hooks.nsh).desktopentries (Linux), or run the bundled NSIS/MSI uninstaller found in the registry (Windows)app.worldmonitor.desktop/app.worldmonitor.tech.desktop/app.worldmonitor.finance.desktopidentifiers (--keep-datato retain)world-monitor: thesecrets-vaultentry plus the legacy per-key entries fromSUPPORTED_SECRET_KEYS), only when uninstalling all variants since the vault is shared (--keep-secretsto retain)--dry-run/-DryRun,--yes/-Yes, and--variant/-Variantdocs/desktop-app.mdxwith the script usage and manual per-platform removal steps.Type of change
Affected areas
scripts/Checklist
api/rss-proxy.jsallowlist (if adding feeds) — N/Anpm run typecheck) — no TS changes;docs:checkandlint:unicodepassDocumentation Alignment Checklist
N/A — no methodology, API/MCP contract, or generated-doc claims changed.
Testing done
bash -nsyntax check;--help,--dry-run,--variant tech, and invalid-variant paths exercised$HOMEon macOS: plantedWorld 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-datapreserved the data dirs while removing the app bundleworld-monitorkeychain entry actually exists, so a machine with no install exits with "Nothing to uninstall"DisplayNameentries Tauri's NSIS/MSI bundlers write, but a smoke test on Windows before merge would be prudent