fix: rename downloaded binary to avoid Windows UAC installer-detection#58
Open
kenhia wants to merge 1 commit into
Open
fix: rename downloaded binary to avoid Windows UAC installer-detection#58kenhia wants to merge 1 commit into
kenhia wants to merge 1 commit into
Conversation
The npm package downloads a Go binary named `atv-installer.exe`. Windows UAC `installer detection` heuristically flags any executable whose filename contains `install` (also setup/update/patch) as requiring administrator elevation. Launched non-elevated via `execFileSync` in cli.js, Windows refuses to start it (`The requested operation requires elevation`); the wrapper swallows the error and exits 1 with no output, so `npx atv-starterkit init` appears to do nothing. Rename the release binary to `atv-inst-tool` (verified not to trigger the heuristic) across goreleaser config and the npm download/run wrapper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
On Windows,
npx atv-starterkit@latest init(and--guided) does nothing and exits with code1and no output.Root cause
The npm package downloads a Go binary named
atv-installer.exeand runs it viaexecFileSyncinnpm/bin/cli.js. Windows UAC has an installer-detection heuristic that automatically flags any executable whose filename containsinstall(alsosetup,update,patch) as an installer requiring administrator elevation. Launched non-elevated, Windows refuses to start it:cli.jscatches the thrown error and doesprocess.exit(err.status || 1)without re-printing the message, so the user just sees a silent exit1.Proof
Running the downloaded binary directly returns
The requested operation requires elevation. Copying the exact same bytes to a name withoutinstall(e.g.atv-tool.exe) runs perfectly with no elevation. Only the filename differs.Fix
Rename the downloaded binary
atv-installer→atv-inst-tool(verified locally to not trigger the heuristic):.goreleaser.yml—project_name+builds[].binarynpm/install.js—BINARY_NAMEnpm/bin/cli.js—BINARY_NAME.gitignore,npm/.gitignore— ignore the new artifact namenpm/README.md— doc referenceTesting
go build+ ran the full npm wrapper (node npm/bin/cli.js init) end-to-end on Windows → scaffolded all files, exit0, no elevation error.go test ./...passes except a pre-existingTestDogfoodPromptParityfailure that also fails on cleanmain(unrelated to this change).Note for maintainers
install.jsfetches the latest release and downloads<BINARY_NAME>_<ver>_<os>_<arch>. This change must ship together with a new GitHub release built from the updated goreleaser config, so the published archive name matches the newatv-inst-toolname.