diff --git a/cmd/windows_agent/main.go b/cmd/windows_agent/main.go index ba230b1..dd57c82 100644 --- a/cmd/windows_agent/main.go +++ b/cmd/windows_agent/main.go @@ -4,6 +4,7 @@ package main import ( + "context" "fmt" "os" @@ -33,7 +34,7 @@ func main() { return } - //tray := &agentTray{svc: s, ctx: context.Background()} + tray := &agentTray{svc: s, ctx: context.Background()} if len(os.Args) > 1 && os.Args[1] == "--set-server-url" { if len(os.Args) > 2 { @@ -87,21 +88,15 @@ func main() { } } - err = s.Run() - if err != nil { - logger.Errorf("Error running service: %s", err) - } - /* - if !service.Interactive() { - err = s.Run() - if err != nil { - logger.Errorf("Error running service: %s", err) - } - } else { - err = tray.foregroundTray() - if err != nil { - logger.Errorf("Error running tray: %s", err) - } + if !service.Interactive() { + err = s.Run() + if err != nil { + logger.Errorf("Error running service: %s", err) } - */ + } else { + err = tray.foregroundTray() + if err != nil { + logger.Errorf("Error running tray: %s", err) + } + } }