x
This commit is contained in:
+1
-1
@@ -84,7 +84,7 @@ func Init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if runtime.GOOS == "window" {
|
||||
if runtime.GOOS == "windows" {
|
||||
utils.Daemon("ready")
|
||||
} else {
|
||||
console.Debug("正在删除旧程序错误...")
|
||||
|
||||
@@ -29,13 +29,14 @@ func main() {
|
||||
}
|
||||
if arg == "-r" { //准备程序->原程序
|
||||
rfix := ".ready.exe"
|
||||
ofix := ".exe"
|
||||
if strings.Contains(os.Args[0], rfix) {
|
||||
err := utils.CopyFile(utils.ProcessName, strings.Replace(utils.ProcessName, rfix, ".exe", -1))
|
||||
err := utils.CopyFile(utils.ProcessName, strings.Replace(utils.ProcessName, rfix, ofix, -1))
|
||||
if err == nil {
|
||||
utils.Daemon("reset")
|
||||
}
|
||||
} else {
|
||||
os.Remove(strings.ReplaceAll(os.Args[0], ".exe", rfix))
|
||||
os.Remove(strings.ReplaceAll(os.Args[0], ofix, rfix))
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user