util/winutil: add RegisterForRestart, allowing programs to indicate their preferences to the Windows restart manager

In order for the installer to restart the GUI correctly post-upgrade, we
need the GUI to be able to register its restart preferences.

This PR adds API support for doing so. I'm adding it to OSS so that it
is available should we need to do any such registrations on OSS binaries
in the future.

Updates https://github.com/tailscale/corp/issues/13998

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
This commit is contained in:
Aaron Klotz
2023-08-17 14:47:01 -06:00
parent 3a652d7761
commit ea693eacb6
9 changed files with 99 additions and 5 deletions

View File

@@ -28,3 +28,5 @@ func lookupPseudoUser(uid string) (*user.User, error) {
}
func IsCurrentProcessElevated() bool { return false }
func registerForRestart(opts RegisterForRestartOpts) error { return nil }