Skip to content

Release 0.7.0: update the Windows app automatically - #52

Merged
Views2k merged 2 commits into
mainfrom
feat/self-update
Nov 21, 2026
Merged

Views2k merged 2 commits into
mainfrom
feat/self-update

Conversation

@Views2k

@Views2k Views2k commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Summary

EE installed by Setup on Windows updates itself from this repository's releases. Releases already publish themselves when a version bump merges; this is the step that puts them on the computer.

  • Two minutes after start and then every hour, EE reads SHA256SUMS of the latest release. A newer Windows installer is downloaded to %LOCALAPPDATA%\Etherlighting Evolved\updates and kept only if its SHA-256 matches that list and its version information names the release.
  • EE runs it silently once nobody has used the window for 10 minutes, no dialog is open and no change is being sent. Setup asks the running copy to quit, as for any upgrade, and starts the new version with --after-update.
  • The new version opens its window on the same pixel rectangle, maximized if it was, or stays in the notification area if it was hidden. The rectangle is saved and applied in screen pixels through Windows, because a size in window units comes out wrong on a screen whose scaling differs from the main screen's.
  • Settings → About has Install updates automatically (on by default), the update state, Check for updates and Install now. With the setting off, nothing contacts GitHub until Check for updates. An installation for all users waits for Install now, because setup then needs administrator approval.
  • An installer that ends while EE still runs, or a download that fails its checks, is tried again a day later. The setup log stays in the updates folder.
  • Setup fix: a silent upgrade no longer turns Start with Windows back on. It applied the first installation's choice again, even after the notification area menu had turned the entry off.
  • The version is 0.7.0, so merging this releases it. The copy installed from that release is the first one that updates itself, starting with the release after it.

The update checks SHA256SUMS over HTTPS but not the build provenance attestation; SECURITY.md says what that covers. The macOS and Linux clients do not update themselves.

Verification

  • Desktop checks: 2,014 pass with the simulator, 26 of them new. They run the updater against a fake GitHub with a test clock and setup launcher: schedule, download, checksum and version mismatch, size limit, plain HTTP, failed and repeated attempts, the records the next start reads, the automatic setting, an installation for all users, the Settings panel and the window placement rule. Removing the quiet-window condition or the HTTPS check makes the matching check fail.
  • Against the real releases, with a temporary probe that is not in this branch: as version 0.6.2, the updater read the live SHA256SUMS, downloaded the 0.6.3 installer (75,947,857 bytes, SHA-256 11e4d029…9135, the published value), accepted its version information and built the setup command. Setup was not run. This found that Inno Setup pads the version strings with spaces, which the product name comparison now ignores.
  • Window placement on the real displays, with a second temporary probe: a transparent window of the app's window class placed by the same code came out at -6232,1012 with 1280 × 400 at 100% scaling on the rack display, where the main display runs at 200%. The first version of the code, which set the size in window units, gave 2560 × 800 there. A maximized window, a window on a 200% display and a rectangle on a missing display also behaved as intended.
  • Setup script, with a throwaway installer built from installer.iss under another app ID: /EEUPDATE starts the app with --after-update, a plain silent install does not, and a silent upgrade leaves the sign-in entry alone where the previous script wrote it again.
  • CI now runs the same silent upgrade over the copy it installed, checks that the updater accepts the built installer, that the sign-in entry stays off, and that the new version starts and quits.
  • Python 3,679 tests, JavaScript 881, ruff and tools/check-repository.py pass.

Not tested: a complete automatic update on an installed copy, from the hourly check to the restarted window. The first one will be the update from 0.7.0 to the release after it.

EE installed by Setup on Windows reads SHA256SUMS of the latest GitHub release two minutes after it starts and
then every hour. It downloads a newer installer into the updates folder, keeps it only if its SHA-256 matches that
list and its version information names the release, and runs it silently once nobody has used the window for 10
minutes, no dialog is open and no change is being sent. Setup asks the running copy to quit as before and starts the
new version with --after-update, which opens the window on the same pixel rectangle, maximized if it was, or stays
in the notification area if it was hidden.

- Core/Updates.cs holds the schedule, the checks on the download, the attempt and window placement records, and the
  retry rule: an installer that ends while EE still runs, or a download that fails its checks, waits a day.
- Settings, About has Install updates automatically (on by default), the update state, Check for updates and
  Install now. With the setting off, nothing contacts GitHub until Check for updates. An installation for all users
  waits for Install now, because setup then needs administrator approval.
- The window rectangle is saved and applied in screen pixels through Windows. A size in window units comes out wrong
  on a screen whose scaling differs from the main screen's: 1280 x 400 on a 100% rack screen became 2560 x 800 with
  the main screen at 200%.
- Setup starts the app after an update only with /EEUPDATE, and it writes the Start with Windows entry only when
  the tasks were chosen. A silent upgrade used to apply the first installation's choice again, which turned the
  entry back on after the notification area menu had turned it off.
- The package step in CI checks that the updater accepts the installer it built, runs the same silent upgrade over
  the installed copy, and checks that the sign-in entry stays off and that the new version starts and quits.
- README, SECURITY.md, the desktop guide, docs/WORKFLOW.md and the changelog describe the update, including that it
  checks SHA256SUMS but not the build provenance attestation.
tools/check-repository.py accepts only the current version after "EE " in a source file, so the expected texts
with a literal version would fail the check as soon as the version moves past 0.7.0.
@Views2k
Views2k enabled auto-merge (squash) November 21, 2026 08:14
@Views2k
Views2k merged commit f42329c into main Nov 21, 2026
3 checks passed
@Views2k
Views2k deleted the feat/self-update branch November 21, 2026 08: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