Skip to content

fix(updater): restart on Linux/macOS after install - #73

Merged
Nic-dorman merged 1 commit into
mainfrom
fix/updater-restart-linux
May 1, 2026
Merged

fix(updater): restart on Linux/macOS after install#73
Nic-dorman merged 1 commit into
mainfrom
fix/updater-restart-linux

Conversation

@Nic-dorman

Copy link
Copy Markdown
Contributor

Summary

tauri-plugin-updater::download_and_install only calls std::process::exit(0) on Windows (see tauri-plugin-updater-2.10.1/src/updater.rs:288, where the comment explicitly says "exit the app through std::process::exit(0) on Windows"). On Linux and macOS it just writes the new binary to disk and returns — the caller has to restart the app explicitly.

Without that restart, on Linux/macOS:

  • the download bar fills to 100%
  • the Finished event fires
  • install_pending_update returns Ok(())
  • …and nothing else happens — the running process keeps the old binary loaded, and the UI is stuck in installing: true forever

Windows is unaffected because the NSIS installer's process::exit path inside download_and_install already tears the running process down, and the installer relaunches the new binary itself.

The fix is one line: call app.restart() after download_and_install returns. AppHandle::restart() returns !, so it replaces the trailing Ok(()). On Windows it's harmless — the installer is already exiting the process by the time control would reach it.

Scope

Affects both stable and pre-release channels — the install path is shared. Technically the same bug existed pre-rc.1 (the JS plugin's Update.downloadAndInstall() also doesn't auto-restart on Linux/macOS — same comment in stores/updater.ts claimed it did) but stable users on Linux/Mac generally don't update via the in-app flow, so it went unnoticed. The new pre-release opt-in toggle (#68) is what made testers actually hit it.

Test plan

Verified locally on Ubuntu 25.10 (kernel 6.17, x86_64):

  • Built a patched 0.6.8-rc.1 AppImage with the fix, opted in to pre-release, triggered update against published rc.2 → download completes, app exits, relaunches as rc.2
  • Verified the misleading "Tauri will restart the app" comment in stores/updater.ts:86 is now accurate (Rust side actually does restart)
  • Suggest verifying on macOS — same code path, same bug, same fix expected to apply
  • Windows regression check: install completes and relaunches as today (no behaviour change expected — the installer's exit happens before restart() would run)

🤖 Generated with Claude Code

`tauri-plugin-updater::download_and_install` only calls
`std::process::exit(0)` on Windows (where the NSIS/MSI installer
takes over the running process). On Linux and macOS it writes the
new binary to disk and returns — the caller has to restart.

Without an explicit `app.restart()`, the in-app updater on Linux
and macOS hits 100% download, the `Finished` event fires, and then
nothing else happens — the running process keeps the old binary
loaded and the UI is stuck in `installing: true` forever.

Affects both stable and pre-release channels (the install path is
shared). Surfaced now because the new pre-release opt-in toggle
made testers actually exercise the in-app updater on Linux for
the first time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman
Nic-dorman merged commit 484f8fd into main May 1, 2026
4 checks passed
@Nic-dorman
Nic-dorman deleted the fix/updater-restart-linux branch May 1, 2026 08:45
Nic-dorman added a commit that referenced this pull request May 1, 2026
Third internal-tester pre-release. Adds on top of rc.2:
- Linux/macOS auto-restart after install (#73) -- closes the "stuck at
  100%" bug where the install completed but the running process kept
  the old binary.
- Teal banner + dialog badge for prerelease updates (#74) -- visual
  consistency with the sidebar PRE-RELEASE indicator.

Closes the V2-237 install path on Linux. Tested on Ubuntu 25.10 with
the rc.1 -> rc.2 upgrade in #73.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nic-dorman added a commit that referenced this pull request May 1, 2026
Fourth internal-tester pre-release. Adds on top of rc.3:
- "Pre-Release" header line above the teal "Update Available" banner
  (#76) -- testers see the channel of the offered update at a glance
  without having to parse the version string.

Cut quickly after rc.3 so testers on rc.1/rc.2 (Linux/macOS) can
exercise the V2-237 + #73 install path twice: once upgrading to rc.3,
then again from rc.3 to rc.4 (verifies the fix is sticky across
multiple upgrade cycles).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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