Unverified Commit a8ed68bd authored by Daniel Hiltgen's avatar Daniel Hiltgen Committed by GitHub
Browse files

launch app hidden (#10962)

When starting the app in the background, start it hidden.
parent 2ae65ae4
...@@ -23,7 +23,7 @@ func startApp(ctx context.Context, client *api.Client) error { ...@@ -23,7 +23,7 @@ func startApp(ctx context.Context, client *api.Client) error {
return errors.New("could not find ollama app") return errors.New("could not find ollama app")
} }
path := strings.Split(link, "Ollama.app") path := strings.Split(link, "Ollama.app")
if err := exec.Command("/usr/bin/open", "-a", path[0]+"Ollama.app").Run(); err != nil { if err := exec.Command("/usr/bin/open", "-j", "-a", path[0]+"Ollama.app").Run(); err != nil {
return err return err
} }
return waitForServer(ctx, client) return waitForServer(ctx, client)
......
...@@ -45,14 +45,11 @@ func startApp(ctx context.Context, client *api.Client) error { ...@@ -45,14 +45,11 @@ func startApp(ctx context.Context, client *api.Client) error {
} }
} }
} }
// log.Printf("XXX attempting to start app %s", appExe)
cmd_path := "c:\\Windows\\system32\\cmd.exe" cmd_path := "c:\\Windows\\system32\\cmd.exe"
cmd := exec.Command(cmd_path, "/c", appExe) cmd := exec.Command(cmd_path, "/c", appExe, "hidden")
// TODO - these hide flags aren't working - still pops up a command window for some reason
cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: 0x08000000, HideWindow: true} cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: 0x08000000, HideWindow: true}
// TODO this didn't help either...
cmd.Stdin = strings.NewReader("") cmd.Stdin = strings.NewReader("")
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment