Skip to content

Commit 0fe8b6f

Browse files
committed
feat: oadin-app 停止oadin问题处理
1 parent fe04feb commit 0fe8b6f

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

internal/constants/global.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const (
2323
UrlDirPathWindows = "/windows"
2424
OssURL = "https://smartvision-aipc-open.oss-cn-hangzhou.aliyuncs.com"
2525
MacOadinExecPath = "/Applications/Oadin.app/Contents/Resources"
26+
WindowsOadinExecPath = "C:\\Program Files\\Oadin"
2627
)
2728

2829
// model related

internal/utils/server/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func StartOadinServer(logPath string, pidFilePath string) error {
4646
}
4747
}
4848
cmd := exec.Command(execCmd, "server", "start")
49-
// oadin-app启动oadin的日志打印
5049
cmd.Stdout = logFile
5150
cmd.Stderr = logFile
5251
if runtime.GOOS == "windows" {
@@ -143,6 +142,9 @@ func TrayStopOadinServer() error {
143142
return fmt.Errorf("failed to find oadin executable: %v", err)
144143
}
145144
}
145+
if runtime.GOOS == "windows" {
146+
execCmd = constants.WindowsOadinExecPath + "\\" + "oadin.exe"
147+
}
146148
cmd := exec.Command(execCmd, "server", "stop")
147149
if runtime.GOOS == "windows" {
148150
utils.SetCmdSysProcAttr(cmd)

tray/systray.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func NewManager(debug bool, logPath, pidPath string) *Manager {
4343
serverRunning: false,
4444
updateAvailable: false,
4545
onServerStart: func() error {
46+
// oadin-app启动oadin的日志打印
4647
return serverUtils.StartOadinServer(logPath, pidPath)
4748
},
4849
onServerStop: func() error {

0 commit comments

Comments
 (0)