Detect installer command failures at execution time#155
Open
camjac251 wants to merge 1 commit into
Open
Conversation
Use the dynamic errorlevel condition inside parenthesized blocks. Percent expansion happens when a block is parsed, so the old checks could miss failures from the command immediately before them.
camjac251
marked this pull request as ready for review
July 17, 2026 22:09
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.
Summary
%ERRORLEVEL%comparisons with the runtimeif errorlevel 1form.mkdirandmklinkare observed immediatelyand routed through the installer's existing error path.
Root cause
cmd.exeexpands%ERRORLEVEL%when it parses a parenthesized commandblock. Six installer checks are inside
if/elseblocks, so they canread the status from before the preceding
mkdirormklinkcommandruns. This can report
OKand continue after an operation failed.if errorlevel 1evaluates the current command status when thatstatement executes, so the check observes the operation immediately
before it.
Verification
cmd.exe: after acommand returned exit status 7, the
%ERRORLEVEL%form printedold-missed, whileif errorlevel 1printednew-detected.git diff --check develop...HEADif errorlevel 1and no%ERRORLEVEL%checks remain.resources/install.batretains CRLF line endings.disposable installation directory.
Compatibility
messages are unchanged.
:errorcontrol-flow paths are unchanged.cmd.exesyntax and does not requiredelayed environment-variable expansion.
but now uses the same error-checking form as the remaining installer.