Repository navigation
CS-2357-Declare asInvoker execution level for remote installer - #3845
Merged
Merged
Conversation
state-remote-installer.exe was triggering a Windows UAC elevation prompt;
when an admin authenticated it, the State Tool installed under the admin
account instead of the invoking user. The binary shipped with no embedded
application manifest, so it declared no requestedExecutionLevel and was
subject to Windows' UAC installer-detection heuristic (which auto-flags
executables whose filename contains "install" for elevation).
Add a single shared application manifest declaring asInvoker/uiAccess=false
and embed it into every State Tool executable via goversioninfo:
- state, state-svc: ManifestPath added to the shared versioninfo.json
template (internal/assets/contents), which is stamped into each
binary's versioninfo.json at preprocess time.
- state-remote-installer: committed versioninfo.json repointed to the
shared manifest (replacing the ad-hoc local manifest).
- state-installer, state-exec, state-mcp: had no resource embedding at
all; added //go:generate goversioninfo, versioninfo.json generation in
preprocess, and a Windows-guarded `go generate` in their build steps.
This opts every binary out of installer-detection auto-elevation so they
run with the invoking user's token. Verified by cross-building each cmd
for windows and confirming the asInvoker manifest is present in the
embedded resource.syso.
Note: this is prevention for new installs. A "Run as administrator" choice
already cached under AppCompatFlags\Layers (RUNASADMIN) overrides the
manifest and must be cleared separately on affected machines.
CS-2357
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
icanhasmath
force-pushed
the
marcg/CS-2357-remote-installer-uac
branch
from
July 17, 2026 16:55
b79c485 to
9eb7124
Compare
mitchell-as
approved these changes
Jul 17, 2026
mitchell-as
left a comment
Contributor
There was a problem hiding this comment.
This looks fine to me crosses fingers
mitchell-as
added a commit
that referenced
this pull request
Jul 17, 2026
…ler-uac CS-2357-Declare asInvoker execution level for remote installer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
state-remote-installer.exefires a Windows UAC elevation prompt on launch. When an admin authenticates at that prompt, the State Tool ends up installed under the admin account instead of the target (invoking) user. Reported by David Cartin / KSA — see epic CS-2338.Root cause
The remote installer ships with no embedded Windows application manifest, so it declares no
requestedExecutionLevel. Windows' legacy UAC installer-detection heuristic auto-flags executables whose filename contains "install"/"setup"/"update" for elevation unless the binary explicitly declaresasInvoker. Becausestate-remote-installer.exematches that heuristic and had no manifest, Windows prompts for elevation.Before this change:
cmd/state-remote-installer/versioninfo.jsonhad"ManifestPath": ""—goversioninfoembeds no manifest when this is empty..manifestfile existed anywhere in the project's own source.Fix
cmd/state-remote-installer/state-remote-installer.exe.manifestdeclaring<requestedExecutionLevel level="asInvoker" uiAccess="false" />.ManifestPathinversioninfo.jsonat that manifest sogoversioninfo(go generate, run by thebuild-remote-installerstep) embeds it intoresource.sysoat build time.This opts the binary out of installer-detection auto-elevation, so it runs with the invoking user's token and restores per-user install behavior. The version-stamping generator (
scripts/versioninfo-generator) preservesManifestPaththrough its struct, so version stamping is unaffected.Verification
Built on Linux/WSL here, so the Windows resource path could not be exercised locally. On a Windows build host:
Then confirm launching as a standard user no longer triggers UAC.
Follow-up (not in this PR)
state-installer.exe(cmd/state-installer) similarly has no manifest and is subject to the same heuristic — worth confirming whether it needs the same treatment.Jira: CS-2357 (under epic CS-2338)
🤖 Generated with Claude Code