Declare asInvoker in the Windows binaries #117
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/windows-asinvoker-manifest"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Removes the cause behind staging the updater under a different name, rather than continuing to avoid one keyword list.
Windows installer detection decides what an executable is by reading its filename: an unmanifested binary named anything like an installer is assumed to need elevation, so
CreateProcessrefuses to launch it from an ordinary process and fails withEACCES. Bun embeds a manifest but declares no execution level, which leaves that guess enabled. DeclaringasInvokerends the guessing for whatever name the binary is ever given.Evidence
Spawning copies of one identical binary on Windows 11, all named
probe-update-*.exe:trustInfoasInvokerThe manifested binary still runs normally, which matters because these are single-file executables with a payload appended past the resource section.
Implementation
mt.exemerges thetrustInfoblock into the compiler's own manifest rather than replacing it, solongPathAwareandheapTypesurvive a Bun upgrade untouched. Merging happens before the artifact is hashed, since the manifest is part of what the digest covers. Applied to the agent CLI's Windows release and to the Windows server binary.resedit was tried first and cannot do this job:
pe-libraryrefuses a Bun executable outright withAfter Resource section, sections except for relocation are not supported. The dependency was backed out, sopackage.jsonand the lockfile are unchanged.Where
mt.exeis absent the build warns and continues rather than failing, because the staged name already avoids the heuristic on its own.PLANNER_MT_EXEoverrides discovery.Verification
Full typecheck, type-aware oxlint, knip, oxfmt pass. A real
build:agent-clirun was inspected: the producedplanner-windows-x64.execarriesrequestedExecutionLevel level="asInvoker" uiAccess="false", still carrieslongPathAware, and runs.No automated test: the behaviour needs a real PE and the Windows SDK, so there is no pure logic left to assert against once the work is a call to
mt.exe. The staged-name regression test from #116 still guards the other half.kReview review
Verdict: no findings
No findings to address in the reviewed diff.
No concrete correctness, security, or release-path defect is established by the visible changes and repository evidence.
Reviewed by kReview at
d1d2a8cbb8. This comment is conservative and based only on the PR diff, metadata, and supplied repository context.Est. cost ~$0.28 (145.9k in / 1.1k out / gpt-5.6-sol).