Repository navigation
feat: let the standalone exe replace itself when it updates - #955
Merged
Merged
Conversation
The updater plugin can only run an installer. Used by the standalone SQLPilot.exe, that left the user's file on the old version and added a second, installed copy. A standalone copy now downloads the new exe through the plugin, which verifies its signature, and stages it beside itself. On restart it renames itself aside, moves the new file into place, starts it and exits. The next launch removes the old file. A failed swap puts the old exe back. A folder it cannot write to is reported rather than falling back to an installer. A copy counts as standalone when no installer stamped its binary. The release now signs SQLPilot.exe, publishes a windows-x86_64-portable entry in latest.json, and fails if the exe carries a stamp. Copies from before this keep updating through the installer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
cache-apt-pkgs-action hit 404s on dev's first run and still reported success, saving an empty cache under the real key. Every later Lint (Rust) run hit that cache, installed nothing and failed in clippy on a missing glib-2.0. Install the packages the way Test Rust already does, with apt-get update first, so a failed install fails its own step and cannot be cached. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI only ran on Linux, so nothing proved what the self-update depends on: that a running exe can be renamed on Windows, that the new one starts from the same path, and that the old file can then be deleted. Move the file handling into mas-update, which has no Tauri, and add a test where a copy of the test binary really replaces itself and restarts. A new Test Windows job runs it and also compiles the app for Windows, which closes the gap where a dependency bump first met Windows in the release build. A new workflow builds the real NSIS and MSI installers and checks that installed copies carry a stamp and the published exe does not. The test also found that a staged file was not executable on Unix, so stage now copies the old file's permissions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bumps the tauri group with 2 updates: [@tauri-apps/plugin-shell](https://github.com/tauri-apps/plugins-workspace) and [@tauri-apps/plugin-updater](https://github.com/tauri-apps/plugins-workspace). Updates `@tauri-apps/plugin-shell` from 2.5.0 to 2.6.0 - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](tauri-apps/plugins-workspace@fs-v2.5.0...fs-v2.6.0) Updates `@tauri-apps/plugin-updater` from 2.14.0 to 2.14.1 - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](tauri-apps/plugins-workspace@updater-v2.14.0...updater-v2.14.1) chore(deps): bump the tauri group in /src-tauri with 2 updates Bumps the tauri group in /src-tauri with 2 updates: [tauri-plugin-shell](https://github.com/tauri-apps/plugins-workspace) and [tauri-plugin-updater](https://github.com/tauri-apps/plugins-workspace). Updates `tauri-plugin-shell` from 2.5.0 to 2.6.0 - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](tauri-apps/plugins-workspace@fs-v2.5.0...fs-v2.6.0) Updates `tauri-plugin-updater` from 2.14.0 to 2.14.1 - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](tauri-apps/plugins-workspace@updater-v2.14.0...updater-v2.14.1) --- updated-dependencies: - dependency-name: "@tauri-apps/plugin-shell" dependency-version: 2.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: tauri - dependency-name: "@tauri-apps/plugin-updater" dependency-version: 2.14.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: tauri - dependency-name: tauri-plugin-shell dependency-version: 2.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: tauri - dependency-name: tauri-plugin-updater dependency-version: 2.14.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: tauri ... Signed-off-by: dependabot[bot] <[email protected]>
cargo Audit was failing on RUSTSEC-2026-0429, a zip 4.x denial of service reached through tauri-plugin-updater. Version 2.14.1 of the plugin moves to zip 9, which also patches the three older zip advisories accepted in KNOWN_ACCEPTED, so all four are fixed and the exceptions can go. zip is held at 9.2.1 rather than the 9.4.2 Dependabot's lockfile chose, because that was published a day ago and the repo waits seven days. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
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 standalone
SQLPilot.exenow replaces itself when it updates, instead of running an installer. This hasn't run on Windows yet, so please don't merge #950 until the checks below pass.Why
The updater plugin can only run an installer. Used by the standalone exe, that adds a second, installed copy and leaves the user's own file on the old version.
What changed
Portableinstall type. On Windows, a release build with no installer stamp (bundle_type()returnsNone) is standalone. The bundler stamps the binary for each installer, then restores it, so the published copy carries no stamp. Debug builds never count as standalone.download_portable_updateuses the plugin'sUpdate::download, which verifies the minisign signature, and stages the bytes next to the exe. A folder it can't write to is reported with what to do next, with no fallback to the installer.apply_portable_updateruns at "Restart to finish update", after the existing checks for running queries and unsaved tabs. It renames the running exe to.old, moves the new file into place, starts it and exits. If the second rename fails, the first is undone. The next launch deletes the old file.SQLPilot.exeand uploads the.sig, andlatest.jsongainswindows-x86_64-portable. The release fails if the exe carries an installer stamp.Both commands refuse to run on any copy that isn't standalone. No new dependency: I dropped
self-replace, since its main job is deleting the old file while still running, and the next launch can do that.Also in this PR
cargo Auditruns here because this PR changesCargo.lock, and it failed on RUSTSEC-2026-0429 inzip. So this PR also movestauri-plugin-updaterto 2.14.1 andtauri-plugin-shellto 2.6.0 (the bumps from #951), which takeszipfrom 4.6.1 to 9.2.1. That patches RUSTSEC-2026-0429, -0367, -0368 and -0369, and the threezipentries come out ofKNOWN_ACCEPTED.zipis held at 9.2.1 because the 9.4.2 in #951 was published on 2026-11-07, inside the seven-day rule.Closes #760.
Upgrade path
Copies already released keep their old update code. They ignore the new manifest key and update through the installer once, and after that they're installed copies. People on those copies need to download
SQLPilot.exeagain to get this behaviour.Testing
Test Windowsjob has a copy of the test binary rename itself while running, put the new file in place, restart from the original path and delete the old file (mas-update/tests/self_swap.rs). It also compiles the app for Windows.windows-bundle-check.ymlbuilds NSIS and MSI and checks that installed copies are stamped and the published exe is not.cargo fmt, Rust unit tests, type-check, ESLint, Vitest, the manifest script tests,check-documented-commands,check-action-pinsanddprint.tauri signer signwas run with a throwaway key and produced the expected format, but no updater has verified one of its signatures.This PR also replaces
cache-apt-pkgs-actioninLint (Rust), which saved an empty cache after a failed install and broke the job ondev.Still needs a person on Windows
latest.jsonA real update can't happen until v1.5.0 updates to the following release.
🤖 Generated with Claude Code