Skip to content

Auto-update: check GitHub Releases and install a verified setup - #17

Merged
Xarishark merged 7 commits into
mainfrom
feat/auto-update
Nov 8, 2026
Merged

Xarishark merged 7 commits into
mainfrom
feat/auto-update

Conversation

@Xarishark

@Xarishark Xarishark commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

What and why

Now that the repo is public, Director can find and install new versions itself, without asking you to download setup again.

  • Window: when it opens, Director asks GitHub's releases/latest endpoint for the newest version (through WinHTTP, using the system proxy). If that version is newer, a notice above every page offers Install update, What's new and a close button. If the check fails, it's only logged, so offline startups stay quiet.

  • Install update: Director downloads Director-x64-setup.exe to %TEMP%\Director-update and runs it only if both of these hold:

    • its size and SHA-256 match the digest GitHub reports for that file;
    • the download link points to this repo's releases.

    Download progress shows as a real progress bar in the window. Director then starts setup with /passive (only setup's progress window, no clicks) and the current DesktopShortcut choice, read from HKLM\Software\Director\Installer, and closes so setup can replace the files. A hidden cmd waits for setup and reopens Director only if setup exits with 0; a cancelled admin prompt (1602) or a pending restart (3010) leaves it closed. Director refuses to update while there are unsaved drafts or staged Now changes.

  • Copies outside Program Files\Director (builds from source) show Download, which opens the release page instead.

  • Options → About: a switch for the startup check (new preference check_for_updates, on by default; preferences stay format version 1) and a Check for updates button.

  • CLI: director update reports whether a newer version exists; director update --install downloads, verifies and starts setup. Commands never check on their own, so shortcuts and Stream Deck buttons stay offline.

  • Docs: INSTALL (Update section), README, SECURITY (updates added to the scope) and an Unreleased CHANGELOG entry.

For reviewers: copies on 0.13.0 don't have this, so users update by hand once. No new dependencies; this uses the existing sha2, serde_json and windows WinHTTP/Registry features. Tests and preview fixtures never contact GitHub, because the startup check is cfg(not(test)).

Checks

  • cargo fmt --all -- --check
  • cargo clippy --locked --all-targets -- -D warnings (run locally without --locked on the newer toolchain; CI runs the pinned version)
  • cargo test --locked -- --test-threads=1 (162 lib + 22 app passed locally)
  • Docs and README updated where behaviour changed
  • THIRD_PARTY_LICENSES.md regenerated if dependencies changed (no dependency changes)

Tested by hand

  • director update against the real GitHub printed "Director 0.13.0 is up to date."
  • The ignored network test update::tests::downloads_and_verifies_the_latest_setup downloaded the real v0.13.0 setup through GitHub's redirect, and the checksum matched.
  • With a temporary build labelled 0.12.0, these all worked, checked through UI Automation:
    • the notice ("Director 0.13.0 is available", with Download because it's a dev copy);
    • the Options switch and the Check for updates button;
    • the manual check, and closing the notice.
  • The cmd waiter, tested with stand-in programs: exit 0 reopens; 1602 and 3010 don't; paths with spaces work.
  • End to end: I installed a local setup of this branch labelled 0.12.0 and pressed Install update. Each step happened: download bar, Director closes, admin prompt, setup's progress window only, Director reopens as 0.13.0 (the real release).

@Xarishark
Xarishark enabled auto-merge November 8, 2026 18:58
@Xarishark
Xarishark disabled auto-merge November 8, 2026 19:02
@Xarishark
Xarishark merged commit 6ea32e8 into main Nov 8, 2026
2 checks passed
@Xarishark
Xarishark deleted the feat/auto-update branch November 8, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant