improve update process for macOS and Linux

This commit is contained in:
josc146
2023-06-09 20:38:19 +08:00
parent a95fbbbd78
commit b7c34b0d42
3 changed files with 27 additions and 22 deletions

View File

@@ -53,12 +53,14 @@ func (a *App) UpdateApp(url string) (broken bool, err error) {
}
return false, err
}
name, err := os.Executable()
if err != nil {
return false, err
if runtime.GOOS == "windows" {
name, err := os.Executable()
if err != nil {
return false, err
}
exec.Command(name, os.Args[1:]...).Start()
wruntime.Quit(a.ctx)
}
exec.Command(name, os.Args[1:]...).Start()
wruntime.Quit(a.ctx)
return false, nil
}