From c6ab442d47361b08221fc8470dc72217bbda4375 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Wed, 10 Mar 2021 12:31:59 +0000 Subject: [PATCH] Replace goxsys IsAnInteractiveSession with IsWindowsService Upstream goxsys deprecated IsAnInteractiveSession. Refs https://github.com/hlandau/service/issues/17 --- service_windows.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/service_windows.go b/service_windows.go index 4de81b3..44d087b 100644 --- a/service_windows.go +++ b/service_windows.go @@ -120,14 +120,6 @@ loop: } } -func isInteractive() bool { - interactive, err := svc.IsAnInteractiveSession() - if err != nil { - return false - } - return interactive -} - func (info *Info) installService() error { svcName := info.Name @@ -276,8 +268,8 @@ func (info *Info) serviceMain() error { // ... } - interactive := isInteractive() - if !interactive { + isService, _ := svc.IsWindowsService() + if isService { return info.runAsService() }