aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/manager
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-12-17 14:45:19 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-12-17 14:45:19 +0100
commit27054088c9e89fd93450ab2a5e405350fb27cc82 (patch)
tree4788c0a49770350ee8546d81df6127c33307a931 /manager
parentversion: bump (diff)
downloadwireguard-windows-27054088c9e89fd93450ab2a5e405350fb27cc82.tar.xz
wireguard-windows-27054088c9e89fd93450ab2a5e405350fb27cc82.zip
manager: do not raise error if manager service is already starting
If the service is in StartPending state, then it means that we were *just* started by something else, so return success here, assuming the other program starting this does the right thing. This can happen when, e.g., the updater relaunches the manager service and then invokes wireguard.exe to raise the UI. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'manager')
-rw-r--r--manager/install.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/manager/install.go b/manager/install.go
index 3983de1d..f1937d0a 100644
--- a/manager/install.go
+++ b/manager/install.go
@@ -56,6 +56,12 @@ func InstallManager() error {
}
if status.State != svc.Stopped {
service.Close()
+ if status.State == svc.StartPending {
+ // We were *just* started by something else, so return success here, assuming the other program
+ // starting this does the right thing. This can happen when, e.g., the updater relaunches the
+ // manager service and then invokes wireguard.exe to raise the UI.
+ return nil
+ }
return ErrManagerAlreadyRunning
}
err = service.Delete()