Skip to content

[MacOS] self updater - #86

Closed
innateessence wants to merge 7 commits into
elripalda:mainfrom
innateessence:self-updater
Closed

innateessence wants to merge 7 commits into
elripalda:mainfrom
innateessence:self-updater

Conversation

@innateessence

Copy link
Copy Markdown
Contributor

enable self updating using the UI

@elripalda elripalda left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for this! An in-app update for the Mac app would be a really good addition. A few things need to change before it can go in:

  1. Leave the Windows path as it is. Windows already updates through the installer (update_launch.rs and the update screen from Beta 34 and 35). That includes the two-strike rule in update_bad.json (update_strike / update_is_bad) and the check that refuses an installer that names another version. This PR swaps it for a standalone executable (windows_binary, self_update.ps1) and drops the strike handling. Please keep update_launcher's Windows branch exactly as it is on main, and leave release.yml, RELEASING.md and the release checks unchanged.
  2. Linux: the AppImage already replaces itself in place on main. If you want to rework it, keep the same result and the same checks. A .deb, or an extracted run, should still open the download page.
  3. macOS is the part that's missing, and it's welcome: stage the new .app bundle, check it, swap it, and relaunch.
  4. The same checks as update_download.rs: only the allowed hosts, a size cap, a required sha256 that matches version.json, and the version check before anything is replaced. On macOS, please also check the bundle's code signature (or at least its Team ID) before swapping it in.
  5. Nothing runs from a writable temp location while the app is still open. Prefer the app's own data folder, and clean up when it fails.
  6. Please rebase onto main (Beta 36 has landed since). Leave it as a draft until it's ready. CI will run once the first-time-contributor run is approved.

Happy to look again whenever you push.


Generated by Claude Code

@innateessence

Copy link
Copy Markdown
Contributor Author

Tested it on my macbook pro, behaves as expected

@innateessence
innateessence marked this pull request as ready for review November 11, 2026 20:30
Copilot AI balanced review requested due to automatic review settings November 11, 2026 20:30

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI 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.

🟡 Changes recommended

The updater can leave the app unlaunchable during replacement and deletes its rollback copy before confirming successful startup, while dialog dismissal and desktop-mode restoration remain incorrect.

4 open issues

Review effort: Balanced

Comment thread src-tauri/src/self_update.sh Resolved
Comment thread src-tauri/src/self_update.rs Resolved
Comment thread src-tauri/src/self_update.sh Resolved
Comment thread ui/more.js Resolved
@innateessence
innateessence marked this pull request as draft November 11, 2026 23:40
@innateessence

Copy link
Copy Markdown
Contributor Author

ran out of tokens, need to address copilots flagged issues still. None are resolved yet.

@Xarishark

Copy link
Copy Markdown
Collaborator

@innateessence mostly fixed do try it now pls

Copilot AI 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.

🟡 Changes recommended

Awaiting animation frames during Mac startup can stall initialization in hidden-window --play launches because WebKit may suspend those frames, so the readiness acknowledgment must not block startup.

1 open issue
4 resolved since last review

Review effort: Balanced

Comment thread ui/app.js Resolved
@innateessence

Copy link
Copy Markdown
Contributor Author

Thanks for this! An in-app update for the Mac app would be a really good addition. A few things need to change before it can go in:

2. **Linux:** the AppImage already replaces itself in place on main. If you want to rework it, keep the same result and the same checks. A `.deb`, or an extracted run, should still open the download page.

Happy to look again whenever you push.

Generated by Claude Code

This is a lie though. I installed the app image from the AUR on my arch box and clicking "Download" just opens a browser to the download page.

Copilot AI 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.

🔵 Needs a closer look

The macOS self-replacement flow requires end-to-end validation with two signed builds because existing test doubles do not exercise bundle swapping, Tauri teardown, relaunch readiness, and rollback together.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@innateessence

innateessence commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll test this build for MacOS and for Arch, if the Linux app image still opens a browser I'll open another PR probably

@Xarishark

Xarishark commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

if the Linux app image still opens a browser I'll open another PR probably

you should not. Your package manager should update the app for the same reason flatpak has the auto updater disabled

@innateessence

Copy link
Copy Markdown
Contributor Author

if the Linux app image still opens a browser I'll open another PR probably

you should not. Your package manager should update the app for the same reason flatpak has the auto updater disabled

I understand this, I'd remove it from my pkg manager once the AppImage actually supports self updating

The pkg just installs/copies the AppImage binary so it's discoverable in my PATH

@innateessence

Copy link
Copy Markdown
Contributor Author

Linux AppImage still does not self-update

@innateessence

Copy link
Copy Markdown
Contributor Author

Looks like startup verification on MacOS is buggy. Failed first try:
image

@innateessence innateessence changed the title self updater [MacOS] self updater Nov 12, 2026
@innateessence

Copy link
Copy Markdown
Contributor Author

Gave this MR a MacOS tag to keep it scoped exclusively to MacOS. I'll make another one for Linux AppImage's so my arch box isn't always lagging behind.

@Xarishark

Copy link
Copy Markdown
Collaborator

The updater wont work until we sign it this is expected behavior if you see your gatekeep notifications in the settings you will see that the app tried to start and failed. if not manually try to download the latest version and you will see it then.

@Xarishark Xarishark self-assigned this Nov 12, 2026
@innateessence

Copy link
Copy Markdown
Contributor Author

The updater wont work until we sign it this is expected behavior if you see your gatekeep notifications in the settings you will see that the app tried to start and failed. if not manually try to download the latest version and you will see it then.

Anything you want me to do to test on my Mac?

@Xarishark

Copy link
Copy Markdown
Collaborator

codesign --force --deep -s - /path/to/YourApp.app

@innateessence

Copy link
Copy Markdown
Contributor Author

Still failing even after signing the App and trying to updater again. Same error.

I'll poke around for logs

@innateessence

Copy link
Copy Markdown
Contributor Author

The self-update log is empty

@Xarishark

Xarishark commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

macos builds are barely out for now. we will most likely either add sparkle or another macos specific update system after we code sign properly. this will be fixed dont worry.

@innateessence

Copy link
Copy Markdown
Contributor Author

Not seeing any prompt to allow the app to launch in my MacOS "Privacy and Security" settings where that would be the problem.

Also made sure the App fully exited before trying again, wasn't running in the background and possibly reusing an unsigned process

@innateessence

Copy link
Copy Markdown
Contributor Author

macos builds are barely out for now. we will most likely either add sparkle or another macos specific update system after we code sign properly. this will be fixed dont worry.

Sounds good. I mostly pivoted to MacOS for other users. This will realistically be running on my arch box

@innateessence

innateessence commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

macos builds are barely out for now. we will most likely either add sparkle or another macos specific update system after we code sign properly. this will be fixed dont worry.

Do you have any objections to making the Linux AppImage self update?
There's probably some concerns there with things like the AUR package recomplauncher-bin

@innateessence

innateessence commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

I think the Linux AppImage should support self updates or we have something like CI/CD update the PKGBUILD for recomplauncher-bin

I think there'll be a lot of users who aren't using Arch based systems though

@Xarishark

Copy link
Copy Markdown
Collaborator

we only support system agnostic packaging people coming from arch are supposed to be self supported thats the whole point of arch. Even then Arch does not condone AUR at all so we just dont provide support there. We will take care of the appimage in place self upgrade that is already on the todo. I am taking a look at the mac build now. Have some patience pls and try to keep replies aggregated because each reply pings everyone involved.

@Xarishark

Copy link
Copy Markdown
Collaborator

I fixed the self updater. will commit in a while

@innateessence

Copy link
Copy Markdown
Contributor Author

I fixed the self updater. will commit in a while

Feel free to tag me if you want me to test and I'll test it out when it's convenient for me

@Xarishark

Copy link
Copy Markdown
Collaborator

@innateessence found why the Mac update kept failing for you, and it isn't signing. This PR waits for the new version to confirm it started (--update-startup + startup.ready). The release you were updating to (beta.41) doesn't have that code, so it can never confirm: after 60 s the helper stops it and puts the old one back. That's the "didn't confirm successful startup" error and the empty log. Re-signing couldn't change it. It can only succeed once two releases in a row have this PR.

Since the Mac updater is a stopgap until we sign properly (then likely Sparkle), I've opened a smaller one that works with the releases already out: #126. It keeps the parts that matter here: sha256 and version checks, signature check, and a rollback. The rollback doesn't need anything from the new version: the old app stays aside until the new one has run 20 s, and comes back if it crashes. Tested on a Mac against the real beta.41, and against a broken build that rolls back.

Your work is credited there. The Big Picture fix from here (B no longer closes a busy dialog) went into its own PR, #127. If you're OK with it, this one can be closed in favour of #126. Thanks for pushing on this and testing on your Mac.

Xarishark added a commit to Xarishark/RecompLauncher that referenced this pull request Nov 13, 2026
The in-place Mac update and its rollback follow elripalda#86, and its testing on a Mac found where the update failed.

Co-authored-by: innateessence <[email protected]>
@Xarishark

Copy link
Copy Markdown
Collaborator

Closing this in favour of #126, which picks up from here. Thanks a lot @innateessence for starting the Mac updater, for the rollback idea, and for testing it on your Mac: that testing is what showed where it was failing. You're credited as co-author on #126.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants