From 6aef8dfe8798e33f7c4e66b4a2fc252188de40e4 Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Wed, 7 Oct 2026 00:53:54 +0530 Subject: [PATCH] fix(desktop): an install another package manager owns gets package-manager removal steps (review) nativeRemovalInstructions told an 'external' Linux install with no AppImage path to delete an AppImage or app directory, which leaves the package registered with missing files. --- apps/desktop/electron/desktop-uninstall.test.ts | 7 +++++++ apps/desktop/electron/desktop-uninstall.ts | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/apps/desktop/electron/desktop-uninstall.test.ts b/apps/desktop/electron/desktop-uninstall.test.ts index 23a7a939ed..f58bf40229 100644 --- a/apps/desktop/electron/desktop-uninstall.test.ts +++ b/apps/desktop/electron/desktop-uninstall.test.ts @@ -69,6 +69,13 @@ test('only standard installs allow desktop uninstall; managed kinds have no safe test('nativeRemovalInstructions names the steward per kind and OS', () => { assert.match(nativeRemovalInstructions('nix', 'linux'), /installed by Nix/) assert.match(nativeRemovalInstructions('nix', 'darwin'), /flake or profile/) + + for (const platform of ['linux', 'darwin', 'win32']) { + const steps = nativeRemovalInstructions('external', platform, '/usr/lib/hermes/hermes') + assert.match(steps, /with that package manager/) + assert.doesNotMatch(steps, /Delete|Trash/) + } + assert.match(nativeRemovalInstructions('bundled', 'win32'), /Installed apps/) assert.equal( nativeRemovalInstructions('bundled', 'darwin', '/Applications/Hermes Agent Canary.app'), diff --git a/apps/desktop/electron/desktop-uninstall.ts b/apps/desktop/electron/desktop-uninstall.ts index 049b93985c..9fb9051a5e 100644 --- a/apps/desktop/electron/desktop-uninstall.ts +++ b/apps/desktop/electron/desktop-uninstall.ts @@ -201,6 +201,14 @@ function nativeRemovalInstructions(kind, platform, appPath = null) { ) } + if (kind === 'external') { + // Deleting a package manager's files by hand leaves the package registered with missing files. + return ( + 'Another package manager installed this Hermes desktop app. ' + + 'Uninstall it with that package manager, the same way you installed it.' + ) + } + if (platform === 'win32') { return 'To uninstall, go to Windows Settings → Apps → Installed apps.' }