Fix Windows auto-update to replace Navis.exe in place (1.8.1).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Navis
2026-07-29 06:58:10 +03:00
co-authored by Cursor
parent 672979be4c
commit fce99cc393
12 changed files with 135 additions and 46 deletions
+3 -4
View File
@@ -61,6 +61,7 @@ func main() {
if update.MaybeFinishUpdate(os.Args[1:]) {
return
}
update.CleanupStaleDownloads()
log.SetFlags(log.LstdFlags | log.Lshortfile)
@@ -342,11 +343,9 @@ func (a *app) applyUpdate() (string, error) {
return "", err
}
_ = a.mgr.Disconnect()
// Hard-exit so Windows unlocks Navis.exe; do not wait on webview.Terminate (can hang).
go func() {
time.Sleep(400 * time.Millisecond)
if a.webview != nil {
a.webview.Terminate()
}
time.Sleep(300 * time.Millisecond)
os.Exit(0)
}()
return "Устанавливается v" + latest + "… Navis перезапустится.", nil