Przeglądaj źródła

cmd/tailscaled: update installSystemDaemonWindows to set the correct system service depndencies

Fixes #16658

Signed-off-by: Aaron Klotz <[email protected]>
Aaron Klotz 7 miesięcy temu
rodzic
commit
bfebf870ae
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      cmd/tailscaled/install_windows.go

+ 10 - 0
cmd/tailscaled/install_windows.go

@@ -25,6 +25,15 @@ func init() {
 	uninstallSystemDaemon = uninstallSystemDaemonWindows
 }
 
+// serviceDependencies lists all system services that tailscaled depends on.
+// This list must be kept in sync with the TailscaledDependencies preprocessor
+// variable in the installer.
+var serviceDependencies = []string{
+	"iphlpsvc",
+	"netprofm",
+	"WinHttpAutoProxySvc",
+}
+
 func installSystemDaemonWindows(args []string) (err error) {
 	m, err := mgr.Connect()
 	if err != nil {
@@ -48,6 +57,7 @@ func installSystemDaemonWindows(args []string) (err error) {
 		ServiceType:  windows.SERVICE_WIN32_OWN_PROCESS,
 		StartType:    mgr.StartAutomatic,
 		ErrorControl: mgr.ErrorNormal,
+		Dependencies: serviceDependencies,
 		DisplayName:  serviceName,
 		Description:  "Connects this computer to others on the Tailscale network.",
 	}