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
+11
View File
@@ -49,3 +49,14 @@ func Apply(ctx context.Context, manifestURL string) (string, error) {
func shellQuote(s string) string {
return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'"
}
// CleanupStaleDownloads removes leftover update temps from failed/old runs.
func CleanupStaleDownloads() {
exe, err := os.Executable()
if err != nil {
return
}
exe, _ = filepath.Abs(exe)
_ = os.Remove(exe + ".new")
_ = os.Remove(filepath.Join(filepath.Dir(exe), ".navis-update-download"))
}