Update in place on macOS and Windows - #73
Merged
Merged
Conversation
The update check knew how to say a release existed and nothing else: the status line named a version and pointed at a URL, and the rest was the user's problem. It now downloads and installs the release on the two platforms where Schist owns its own install, and stays out of the way on the one where it does not. macOS unpacks Schist.zip beside the running bundle and swaps it in with a rename, having first held the download to this copy's signature -- a signed bundle only takes an update signed by the same team, and any signature present must pass `codesign --verify --strict`. The old bundle steps aside rather than being deleted, so a failed swap rolls back. Windows hands the setup exe to a detached process that waits for this one to exit, since a running schist.exe cannot be overwritten, installs silently and starts the result. Linux installs nothing: a copy from pacman, apt or an AppImage belongs to whatever put it there, so the dialog names the version and links to the release. Self-updating only offers itself where the copy is one we may replace: a writable .app bundle, or the directory holding the uninstall.exe the NSIS installer writes. A loose exe or a cargo build is left alone. Restarting goes through `request_quit`, so unsaved documents are still asked about, and the launch-time check (once a day, and a preference away from never) yields to any dialog the user already has open. Update handling moves out of crash.rs into its own module on the way; what is left there is crash reporting, which is all its name claimed.
IAmJSD
force-pushed
the
t3code/add-desktop-autoupdate-flow
branch
from
August 29, 2026 21:17
f4cb716 to
98d8be6
Compare
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.
The update check knew how to say a release existed and nothing else — the status line named a version and pointed at a URL, and the rest was the user's problem. It now downloads and installs the release on the two platforms where Schist owns its own install, and stays out of the way on the one where it does not.
What it does
macOS unpacks the release's
Schist.zipbeside the running bundle (a rename cannot cross volumes) and swaps it in with a rename. The download is held to this copy's signature first: a signed bundle only takes an update signed by the same team, and any signature present must passcodesign --verify --strict. The old bundle steps aside rather than being deleted, so a failed swap rolls back. A relauncher waits on our PID andopens the new bundle.Windows hands
Schist-<version>-setup.exeto a detached process that waits for this one to exit — a runningschist.execannot be overwritten — then runs it/Selevated and starts the result unelevated.Linux installs nothing. A copy from
pacman,aptor an AppImage belongs to whatever put it there, so the dialog names the new version and links to the release.Self-updating only offers itself where the copy is one Schist may replace: a writable
.appbundle, or the directory holding theuninstall.exethe NSIS installer writes. A looseschist.exeor acargo runbuild is left alone, and gets the Linux treatment.The dialog
Later·Release Notes·Update and Restart, with a progress bar while the download runs and a Cancel that abandons it. Escaping the dialog mid-download is a cancel too — dismissing the thing that asked must not leave an update to land on its own. Restarting goes throughrequest_quit, so unsaved documents are still prompted for; backing out of one of those prompts leaves the update staged rather than lost.Preferences gains "Check for new releases at launch" (on by default). That check runs at most once a day, does not consume the day when it fails to reach GitHub, and yields to any dialog the user already has open.
Notes
crash.rsintocrates/app/src/update.rs; what is left there is crash reporting, which is all its name claimed.Schist.zip,Schist-<version>-setup.exe). Renaming either inrelease.ymlwithout changingupdate.rswould silently end self-updating — written down in the new "Updating" section ofdocs/versioning.md.Testing
cargo fmt --check,cargo clippy -p schist-app --all-targets -- -D warningsandcargo test -p schist-app(40 passed) are green. Both platform paths that Linux compiles away were type-checked as well: macOS by retargeting itscfg, Windows through thex86_64-pc-windows-gnucross-check. Neither install path has been exercised against a real release yet — that wants a tagged build on each platform.🤖 Generated with Claude Code