Repository navigation
In-app update: Update Now downloads, installs and restarts DraftCraft - #5
Merged
Merged
Conversation
The update window gets Update Now beside Download: DraftCraft downloads the new release, checks it against the release's SHA256SUMS.txt, puts it in place of the running copy and offers Restart Now / Later. A progress bar shows the download, Cancel stops it; Restart Now quits through the normal close, so unsaved drawings are asked about first. - crates/ui-egui/src/self_update.rs: how this copy was installed (macOS DraftCraft.app with bundle id dev.skryx.draftcraft, a Windows folder with DraftCraft.exe, a Linux AppImage), the release file it updates from, the download (craft_update::Http::download: resumable, SHA-256 checked, only SkryxDev/DraftCraft release downloads), the swap (macOS: the app copied out of the read-only mounted DMG, its bundle id and version checked, swapped in by renaming; Windows: unzipped beside it, running files renamed to *.old; Linux: renamed over the AppImage), the relaunch after the window closes and the cleanup of leftovers at the next start. Any other copy (a build from source, a folder this account can't write) keeps the release page. - updates_ui.rs: Update Now, the progress, installed and failed windows; a cancelled unsaved-changes prompt cancels the relaunch. - main.rs: leftovers cleaned at start, the relaunch after run_native returns. - Italian and Chinese strings; docs/releasing.md says which release names installed copies depend on. Version 2.0.2. craft_update::self_update isn't used: it only recognises ai.storyteller.* bundles on macOS and refuses unsigned builds on Windows. Co-Authored-By: Claude Opus 5.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.
What it does
The update window gets Update Now: DraftCraft downloads the new release, checks it, puts it in place of the running copy and offers Restart Now / Later. No more downloading the DMG, zip or AppImage by hand for every update.
DraftCraft.app(bundle iddev.skryx.draftcraft)draftcraft-macos-arm64.dmgditto, then swapped in by renamingDraftCraft.exedraftcraft-windows-{x64,arm64}.zip*.old(Windows allows that), the new one moved in$APPIMAGE)draftcraft-linux-x86_64.AppImageAt the next start, what the swap left behind (the old app,
*.oldfiles, the staging folder) is deleted.Why not
craft_update::self_updatecraft-updatehas a self-updater, but on macOS it only recognises bundles whose id isai.storyteller.<id>, and on Windows it refuses unsigned builds (ours aren't signed). Socrates/ui-egui/src/self_update.rsdoes the swap itself and reuses craft-update for the rest:Http::download(resumable, SHA-256 checked, cancellable),parse_sha256sums/apply_sums, anddownload_url_under(onlyhttps://github.com/SkryxDev/DraftCraft/releases/download/…).Safety
SHA256SUMS.txt. Downloads are capped at 600 MB.DraftCraft.exeis in the zip.unwrap,expector panics outside tests; every step returns an error, shown in the window together with the Download button.Tried
DraftCraft.app, run withDRAFTCRAFT_PRETEND_VERSION=2.0.0. Update Now downloaded the live v2.0.1 DMG, checked and swapped it, and Restart Now opened DraftCraft 2.0.1, with a valid signature.cargo xtask ciVersions
v2.0.2tag.docs/releasing.mdnotes that the release file names, the zip'sDraftCraft/folder andSHA256SUMS.txtmust stay as they are, or installed copies can no longer update themselves.🤖 Generated with Claude Code