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
+5 -2
View File
@@ -17,7 +17,7 @@ import (
)
// CurrentVersion is the shipped client version.
const CurrentVersion = "1.8.0"
const CurrentVersion = "1.8.1"
// DefaultManifestURL is the update feed (hosted in the project git repo).
const DefaultManifestURL = "https://git.evilfox.cc/test2/navi/raw/branch/main/dist/update.json"
@@ -250,7 +250,10 @@ func prepareDownload(ctx context.Context, manifestURL string) (latest, url, sha,
if err != nil {
return "", "", "", "", "", err
}
tmp := exe + ".new"
tmp := filepath.Join(filepath.Dir(exe), ".navis-update-download")
_ = os.Remove(tmp)
// Also clear legacy leftover from older updaters.
_ = os.Remove(exe + ".new")
if err := downloadFile(ctx, st.URL, tmp); err != nil {
return "", "", "", "", "", err
}