Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Running updatecli build artifacts on Windows (both the official release updatecli.exe and a local
make build output dist/updatecli_windows_amd64_v1/updatecli.exe) triggers a UAC elevation prompt,
or fails outright when launched non-interactively:
The requested operation requires elevation. (Win32 error 740 = ERROR_ELEVATION_REQUIRED)
This is unrelated to updatecli's own code. Windows Installer Detection classifies executables
whose file name contains the keywords install, setup or update as installers and forces them to
start elevated. updatecli binaries embed no application manifest (hence no
requestedExecutionLevel), so the heuristic applies — and the update in updatecli matches a
keyword.
Expected Behavior
A plain CLI tool that does not declare requestedExecutionLevel=requireAdministrator should not ask
for administrator rights when launched from Explorer or a shell. Installer detection is only supposed
to kick in for candidates without a requestedExecutionLevel; updatecli is being misclassified as an
installer, and the correct fix is to declare asInvoker explicitly so the heuristic is bypassed.
Steps To Reproduce
Option 1 (official artifact, fastest): double-click updatecli.exe in Explorer, or run
.\updatecli.exe version in PowerShell / Windows Terminal.
Option 2 (measurable, proves the file name is the only variable): keep the exact same bytes and only
rename the file, then launch it through CreateProcess (Go's os/exec, C's CreateProcessW,
PowerShell's Start-Process are all equivalent):
cd <extracted-directory>
Copy-Item .\updatecli.exe .\mytool.exe
Copy-Item .\updatecli.exe .\myupdater.exe
Copy-Item .\updatecli.exe .\updatecli_check.exe
Get-FileHash .\updatecli.exe, .\mytool.exe, .\myupdater.exe, .\updatecli_check.exe # all hashes identicalThen execute each of them (e.g. .\mytool.exe version).
Option 3 (minimal repro, detached from updatecli):
go build -o plain.exe . # main.go: func main() { fmt.Println("hello") }
copy plain.exe updateprobe.exe # same bytes, only the file name changesRun plain.exe and updateprobe.exe.
Actual behavior
| File name (identical bytes) | Keyword hit | Result |
|---|---|---|
updatecli.exe |
update |
❌ errno 740 ERROR_ELEVATION_REQUIRED |
updatecli_check.exe |
update |
❌ errno 740 |
myupdater.exe |
update |
❌ errno 740 |
setup_x.exe (earlier run, same bytes) |
setup |
❌ errno 740 |
mytool.exe |
none | ✅ runs fine |
updcli_check.exe |
none | ✅ runs fine |
Minimal repro (Go hello world, 2.5 MB):
./hello/plain.exe -> OK
./hello/updateprobe.exe -> errno=740 (The requested operation requires elevation.)
Interactively: double-clicking in Explorer shows the "Do you want to allow this app to make changes
to your device?" consent dialog; running .\updatecli.exe version from PowerShell fails with
This command cannot be run due to the error: The requested operation requires elevation.
Both paths surface the same ERROR_ELEVATION_REQUIRED returned by the AppInfo service at
CreateProcess time.
Environment
| Item | Value |
| --- | --- |
| OS | Windows 11 Enterprise LTSC 2024, `10.0.26100` |
| Session | Interactive, non-elevated administrator (Admin Approval Mode, UAC on) |
| updatecli | v0.121.0, asset `updatecli_Windows_x86_64.zip` |
| Asset SHA-256 | `e1dfc533b49398e9c813098804619e483b802ee790fc460b435380dc560ef916` (zip) |
| `updatecli.exe` SHA-256 | `ea63c838a2c8bc77f069f8e5b4f4db7200672d6c745aa086496c3dfbf68b8891` |
| Binary | 139,365,888 bytes, PE32+ / `IMAGE_FILE_MACHINE_AMD64`, Subsystem 3 (Console), `CGO_ENABLED=0` |
| Go (for the minimal repro) | `go1.27.1 windows/amd64` |
| Relevant policy | `EnableInstallerDetection = 1`, `EnableLUA = 1`, `ConsentPromptBehaviorAdmin = 5`, `ValidateAdminCodeSignatures = 0` (`HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System`) |Pipeline Graph
OpenTelemetry Trace
No response
Anything else?
Root cause
- Windows Installer Detection (implemented by the AppInfo service, governed by the
User Account Control: Detect application installations and prompt for elevationpolicy, enabled
by default) inspects an executable before process creation. The checked attributes include: file
name keywords (install,setup,update); version-resource fields (Vendor, Company Name,
Product Name, File Description, Original Filename, Internal Name, Export Name); the embedded
side-by-side manifest; specificStringTableentries; resource data; and targeted byte sequences. - The same documentation states the override: when the embedded manifest contains a
requestedExecutionLevel, Installer Detection is bypassed ("When the requestedExecutionLevel is
present in the embedded application manifest, it overrides Installer Detection."). - This repository does not satisfy the override condition:
updatecli.exehas no.rsrcsection; the stringsrequestedExecutionLevel,trustInfoand
VS_VERSION_INFOare absent from the binary (the Go linker emits neither a manifest nor version
resources by default);- the repo contains no
.syso,.rcor.manifestfile, and.goreleaser.ymlhas nowindows:
metadata section.
- The only matching check is therefore the file name:
updateclicontainsupdate→ classified
as an installer/updater →CreateProcessreturnsERROR_ELEVATION_REQUIRED(740) → ShellExecute
takes the elevation path and shows the UAC prompt. - It fires regardless of architecture: the Vista-era documentation claims "Installer Detection only
applies to: 1. 32 bit executables", yet on Windows 11 26100 the heuristic demonstrably fires for
PE32+ amd64 binaries, so that statement is outdated and "we are 64-bit" is not an exemption.
Proposed fix
Embed an application manifest that declares asInvoker (verified: the same updateprobe.exe file
name returns errno 740 without the manifest and runs normally with it):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>Integration:
-
Add
winres/manifest.xml(or ago-winreswinres.jsonresource description); -
Generate resource objects, relying on Go's per-suffix inclusion so non-Windows builds are
unaffected:rsrc -manifest winres/manifest.xml -arch amd64 -o rsrc_windows_amd64.syso rsrc -manifest winres/manifest.xml -arch arm64 -o rsrc_windows_arm64.syso
-
Invoke it from
.goreleaser.yml'sbefore.hooks(same pattern as the existing
scripts/completions.shandscripts/manpages.sh), or simply commit the.sysofiles; -
Optional: also add version resources. Make sure fields such as FileDescription do not contain
install/setup/update— the current descriptionA declarative update policy engine.
containsupdate, which is a separate heuristic attribute (harmless once the manifest is present,
but not worth betting on).
Workaround
Rename the binary so it does not contain the keywords (verified: mytool.exe and updcli_check.exe
run fine). Downside: it diverges from the documented binary name and shell completions, so it is not
a long-term fix. On managed machines, disabling User Account Control: Detect application installations and prompt for elevation via secpol.msc / Group Policy also works, but that lowers
the security baseline and is not recommended.
Related reports and prior art
-
No existing report in this repository. As of 2026-09-17, searching issues (open and closed),
pull requests and discussions ofupdatecli/updatecliforUAC,elevation,administrator,
privilege,installer detection,requires admin,asInvoker,syso,manifest.xmland
requestedExecutionLevelreturns nothing related to this behaviour. -
The same root cause has been reported in other projects:
- Windows UAC installer-detection blocks tests/add_remove_update.exe yukimemi/kata#109 — Windows UAC installer-detection blocks tests/add_remove_update.exe
(Rust integration-test binaryadd_remove_update-<hash>.exefails withos error 740before
mainis entered; proposed fix is a rename). - pixi-install-to-prefix has started to trigger the Windows Installer detection heuristic pavelzw/pixi-install-to-prefix#69 — pixi-install-to-prefix has started to trigger the Windows
Installer detection heuristic (reporter: renaming the executable topipr.exemakes it work;
attributed to the unsigned exe containing the word "install").
- Windows UAC installer-detection blocks tests/add_remove_update.exe yukimemi/kata#109 — Windows UAC installer-detection blocks tests/add_remove_update.exe
-
Microsoft documentation:
- Installer Detection technology, the attributes it checks and the manifest override:
https://learn.microsoft.com/en-us/previous-versions/aa905330(v=msdn.10) - Current guidance confirming the fix: "your application may attempt to run with administrator
permissions because of installer detection logic on Windows. In this case, you can set the
requestedExecutionLevelattribute in the application manifest toasInvoker" —
https://learn.microsoft.com/en-us/visualstudio/deployment/security-versioning-and-manifest-issues-in-clickonce-deployments
- Installer Detection technology, the attributes it checks and the manifest override:
-
Measured keyword matrix (same 2.5 MB hello-world binary, only the file name changes, Windows 11
26100 amd64):Triggers elevation (740) Does not trigger update.exe,updater.exe,install.exe,installcli.exe,setup.exe,setupcli.exe,uninstall.exepatch.exe,upgrade.exe,version.exe,deploy.exe,mytool.exe,updcli.exe,hello.exeNote:
patchandupgradedo not trigger on this build of Windows, even though they are often
listed next to the documented keywords;uninstalldoes, because it containsinstall.
Appendix: verification harness
The following Go program launches the given executables via os/exec (i.e. CreateProcess) and
prints the Windows error code. It reproduces the table above without popping UAC (you only get the
740 error code; double-click in Explorer to see the prompt itself).
package main
import (
"errors"
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
for _, p := range os.Args[1:] {
err := exec.Command(p, "version").Run()
switch {
case err == nil:
fmt.Printf("%-24s -> OK\n", p)
default:
var errno syscall.Errno
if errors.As(err, &errno) {
fmt.Printf("%-24s -> errno=%d (%v)\n", p, uintptr(errno), errno)
} else {
fmt.Printf("%-24s -> %v\n", p, err)
}
}
}
}$ go run runprobe.go ./updatecli.exe ./mytool.exe ./myupdater.exe ./updcli_check.exe
./updatecli.exe -> errno=740 (The requested operation requires elevation.)
./mytool.exe -> OK
./myupdater.exe -> errno=740 (The requested operation requires elevation.)
./updcli_check.exe -> OK
Activity
olblak commentedon Sep 23, 2026
Thanks for the detailed issue, I didn't know we could avoid this situation without a code sign certificate
mvanhorn commentedon Nov 28, 2026
The executable had no manifest declaring its requested execution level. With installer detection enabled, Windows could treat the word
updatein the executable name as a reason to require elevation.The Windows amd64 and arm64 builds now embed a manifest declaring
asInvoker, so updatecli inherits the caller’s privileges. The architecture-specific resource objects are checked in and can be regenerated withgo generate.#11547
fix: embed Windows asInvoker application manifest to prevent UAC elev…