Skip to content

Uninstall from Settings breaks the running app when a step fails #413

Closed

Description

@M4n0x

What happens

Settings → General → Uninstall StableBar… runs every step inside the running bar. It resets StableBar's permissions, deletes its caches and preferences and moves StableBar.app to the Trash. Then:

  • when every step succeeds, it quits at once;
  • when any step fails, or Homebrew installed the app, it keeps running to show Some steps still need you and waits for Quit StableBar.

In the second case the app is still running without its bundle, preferences or permissions. On another Mac this showed an error about missing files, then an exception, and Quit StableBar stopped working. Accessibility was removed while the bar was still on screen, before the rest was put back.

Steps to reproduce

  1. Install StableBar from the DMG into /Applications and finish setup.
  2. Make any uninstall step fail, for example by cancelling the administrator prompt for the stablebar command.
  3. Settings → General → Uninstall… → Uninstall.

Expected

A failed step leaves StableBar intact and lists what still needs doing, and Quit StableBar always quits. Permissions are reset, and caches, preferences and the app removed, only once the bar has stopped.

Environment

StableBar 0.9.0 or later (Uninstall shipped in 0.9.0, #332). Reported from a second Mac. The macOS version and the step that failed weren't recorded.

Evidence

  • A moved bundle returns stale paths. A test app that moved its own bundle while running, as the last step does, kept getting the old URL from Bundle.main.url(forResource:). Reading that URL then failed with "no such file". StableBar force-unwraps some of these reads, such as the setup backdrop in SetupTour.swift (NSImage(contentsOf: …)!), so one of them crashes instead of failing.
  • Deleting a cache folder can fail while it is in use. FileManager.removeItem fails with the misleading "couldn't be removed because you don't have permission to access it" (NSCocoaErrorDomain 513) when a file appears in the folder during the delete. StableBar's own URL cache still writes to ~/Library/Caches/org.stablebar.app while the files step runs.
  • tccutil reset All <bundle ID> succeeds when an app runs it, so the permission reset itself isn't what fails.

Diagnosis

  • Sources/StableBar/Uninstall.swift: UninstallSnapshot.steps puts .permissions, .files and .app last. UninstallSystem.perform runs them in the app's own process.
  • Sources/StableBar/UninstallView.swift, uninstall(): it quits only when every step succeeded and Homebrew didn't install the app. Otherwise it shows the outcomes and leaves the half-removed app running.
  • Uninstall.run keeps going after a failure, so the app is moved to the Trash even when an earlier step failed.

Proposal

Uninstall in two phases.

  1. In the app: quit other copies, turn off the menu bar's auto-hide, turn off Open at login, remove the stablebar command, delete Keychain tokens and trash the configuration. Failures are listed while StableBar is still whole, and Quit StableBar stays available.
  2. After the bar quits: a helper started from StableBar's own executable waits for the bar to exit. It then resets permissions, deletes caches and preferences, and moves the app to the Trash unless Homebrew installed it. If one of these fails, it shows an alert with the manual steps.

StableBar --uninstall already runs in a separate process that quits the bar first, so it can keep running every step itself.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    bug
    on Nov 2, 2026
  2. stablebar-releases commented on Nov 2, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.10.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions