fix(upgrader): support Windows executable naming for nginx-ui during core upgrade

This commit is contained in:
Jacky 2025-05-04 04:08:57 +00:00
parent 5120b63618
commit 6ae85e00a1
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D

View file

@ -242,7 +242,13 @@ func (u *Upgrader) PerformCoreUpgrade(tarPath string) (err error) {
return
}
f, err := os.Open(filepath.Join(tempDir, "nginx-ui"))
nginxUIExName := "nginx-ui"
if u.OS == "windows" {
nginxUIExName = "nginx-ui.exe"
}
f, err := os.Open(filepath.Join(tempDir, nginxUIExName))
if err != nil {
err = errors.Wrap(err, "PerformCoreUpgrade open error")
return