This commit is contained in:
cdle
2023-06-07 19:17:12 +08:00
parent 1f02e78ea0
commit f7af099830
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ func main() {
if arg == "-d" {
d = true
}
if arg == "-r" && strings.Contains(os.Args[0], ".ready.exe") { //准备程序原程序
if arg == "-r" && strings.Contains(os.Args[0], ".ready.exe") { //准备程序->原程序
err := utils.CopyFile(utils.ProcessName, strings.Replace(utils.ProcessName, "ready.exe", ".exe", -1))
if err == nil {
utils.Daemon("reset")
+2 -2
View File
@@ -200,11 +200,11 @@ func Daemon(str ...string) {
first = str[0]
}
args := os.Args[1:]
if first == "ready" {
if first == "ready" { //原->准备
os.Args[0] = strings.Replace(os.Args[0], ".exe", ".ready.exe", -1)
args = append(args, "-r")
}
if first == "reset" {
if first == "reset" { //准备->原
os.Args[0] = strings.Replace(os.Args[0], ".ready.exe", ".exe", -1)
}
execArgs := make([]string, 0)