max / makenotwork
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'); |