Skip to content

CS-2357-Declare asInvoker execution level for remote installer - #3845

Merged
mitchell-as merged 1 commit into
masterfrom
marcg/CS-2357-remote-installer-uac
Jul 17, 2026
Merged

mitchell-as merged 1 commit into
masterfrom
marcg/CS-2357-remote-installer-uac

Conversation

@icanhasmath

@icanhasmath icanhasmath commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

state-remote-installer.exe fires 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 declares asInvoker. Because state-remote-installer.exe matches that heuristic and had no manifest, Windows prompts for elevation.

Before this change:

  • cmd/state-remote-installer/versioninfo.json had "ManifestPath": "" — goversioninfo embeds no manifest when this is empty.
  • No .manifest file existed anywhere in the project's own source.

Fix

  • Add cmd/state-remote-installer/state-remote-installer.exe.manifest declaring <requestedExecutionLevel level="asInvoker" uiAccess="false" />.
  • Point ManifestPath in versioninfo.json at that manifest so goversioninfo (go generate, run by the build-remote-installer step) embeds it into resource.syso at 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) preserves ManifestPath through 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:

cd cmd/state-remote-installer && go generate   # regenerates resource.syso
go build .
sigcheck -m state-remote-installer.exe          # confirm asInvoker block present

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

@icanhasmath icanhasmath changed the title Declare asInvoker execution level for remote installer (CS-2357) CS-2357-Declare asInvoker execution level for remote installer Jul 17, 2026
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>

@mitchell-as mitchell-as left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me crosses fingers

@mitchell-as
mitchell-as merged commit 9ed629a into master Jul 17, 2026
21 of 47 checks passed
@mitchell-as
mitchell-as deleted the marcg/CS-2357-remote-installer-uac branch July 17, 2026 18:01
mitchell-as added a commit that referenced this pull request Jul 17, 2026
…ler-uac

CS-2357-Declare asInvoker execution level for remote installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants