Relaunch through UAC when (un)installing the service unprivileged

--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'.
This commit is contained in:
mram
2026-09-21 08:00:24 +02:00
parent 802a64280f
commit fbab0bba33
7 changed files with 157 additions and 16 deletions
+3 -3
View File
@@ -97,9 +97,9 @@ go build ./cmd/gpu-turnstile
### Run natively on Windows (current primary deployment)
Download `gpu-turnstile.exe` from a release and install it as a Windows
service from an elevated shell — the installer creates the canonical
layout, copies the binary and (if none exists yet) your
`gpu-turnstile.env` into it, and registers the copy:
service — no admin shell needed, a UAC prompt appears automatically and
the elevated child does the work (its window waits for Enter so you can
read the result):
```sh
gpu-turnstile.exe --install-service # installs into Program Files, auto-start