Skip to content

Commit

Permalink
20181206
Browse files Browse the repository at this point in the history
  • Loading branch information
yangjinhe committed Dec 6, 2018
1 parent 8f09b1d commit b00203d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os"
"path/filepath"
"runtime"
"strings"
)

var currentServerName string
Expand Down Expand Up @@ -142,8 +143,17 @@ func setAutoRun() bool {
return false
}
fmt.Println(dir)
split := strings.Split(os.Args[0], string(os.PathSeparator))
exeName := ""
if len(split) > 0 {
fmt.Println(split[len(split)-1])
exeName = split[len(split)-1]
} else {
exeName = os.Args[0]
}
fmt.Println(exeName)

var exec = dir + string(os.PathSeparator) + os.Args[0]
var exec = dir + string(os.PathSeparator) + exeName
app := &autostart.App{
Name: "goproxy-gui",
DisplayName: "goproxy的图形界面",
Expand All @@ -170,7 +180,17 @@ func unSetAutoRun() bool {
return false
}
fmt.Println(dir)
var exec = dir + string(os.PathSeparator) + os.Args[0]
split := strings.Split(os.Args[0], string(os.PathSeparator))
exeName := ""
if len(split) > 0 {
fmt.Println(split[len(split)-1])
exeName = split[len(split)-1]
} else {
exeName = os.Args[0]
}
fmt.Println(exeName)

var exec = dir + string(os.PathSeparator) + exeName
app := &autostart.App{
Name: "goproxy-gui",
DisplayName: "goproxy的图形界面",
Expand Down

0 comments on commit b00203d

Please sign in to comment.