--install-service/--remove-service on Windows no longer fail with 'Access is denied' from a normal shell: the process re-runs itself via ShellExecuteEx 'runas', waits for the elevated child and mirrors its exit code. The child gets --elevated-child and pauses for a keypress so its console output stays readable. Declining the prompt reports 'UAC prompt declined'.
9 lines
277 B
Go
9 lines
277 B
Go
package service
|
|
|
|
import "errors"
|
|
|
|
// ErrUserCancelled is returned by RelaunchElevated when the user declines
|
|
// the UAC prompt. Windows-only in practice; defined here so cross-platform
|
|
// callers can compare against it.
|
|
var ErrUserCancelled = errors.New("UAC prompt declined")
|