Install updates in place instead of requiring a manual drag to Applications - #10
Open
arnabbagxd wants to merge 1 commit into
Open
Install updates in place instead of requiring a manual drag to Applications#10arnabbagxd wants to merge 1 commit into
arnabbagxd wants to merge 1 commit into
Conversation
…ations Clicking "Update" previously just opened the downloaded .dmg and left the user to drag the app into Applications themselves — confusing, since the button implied it would just update. AppUpdateInstaller now mounts the .dmg (or unzips a .zip), atomically swaps the new app bundle in for the running one (the same trick Sparkle uses — safe even while the old app is running), and relaunches. Falls back to the old manual-open flow if the in-place install fails for any reason (e.g. no write access). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.dmg/.zipand left the user to drag the new app into/Applicationsand relaunch it themselves — the button implied a full update, but nothing was actually replaced.AppUpdateInstallernow mounts the.dmg(or unzips a.zipviaditto), locates the.appinside it, and atomically swaps it in for the currently running app bundle withFileManager.replaceItemAt— the same technique Sparkle uses, which is safe even while the old app is still running (Unix keeps the old inode alive until the process exits).open -n) and quits the old process.Why
User-reported confusion: people who already had the app installed would get the update prompt, click "Update," and nothing visibly happened to their installed copy — they had to notice the mounted disk image and manually drag-replace it themselves.
Test plan
swift build— cleanswift test— 16/16 passing.app→ copy → atomicreplaceItemAt→ unmount pipeline against a real built.dmg, targeting a throwaway app copy (not the live dev app): confirmed the bundle's modification date changed and the executable remained present and executable at the same path afterwardNotes for reviewers
🤖 Generated with Claude Code