Skip to main content

max / makenotwork

tauri-updater-ui: relaunch into the new version after install downloadAndInstall replaces the app on disk but does not restart it, so the UI sat at "Restarting..." forever. Call window.__TAURI__.process.relaunch() after a successful install (best-effort: host app must register the process plugin; falls back to a "quit and reopen" message if absent, so apps without it aren't broken). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-06-08 04:49 UTC
Commit: 59fc47337d3ab2c565ea228079b2e8fcca6e6c3b
Parent: b059037
1 file changed, +8 insertions, -0 deletions
@@ -163,6 +163,14 @@ function initUpdater(opts) {
163 163 try {
164 164 await pendingUpdate.downloadAndInstall(onEvent);
165 165 status.textContent = 'Update installed. Restarting...';
166 + // Relaunch into the new version. Best-effort: requires the host app
167 + // to register the process plugin; if it's absent the install still
168 + // succeeded and the user can restart manually.
169 + try {
170 + await window.__TAURI__.process.relaunch();
171 + } catch (e) {
172 + status.textContent = 'Update installed. Please quit and reopen the app.';
173 + }
166 174 } catch (err) {
167 175 status.textContent = 'Update failed: ' + err;
168 176 ui.showToast('Update failed: ' + err, 'error');