Skip to content

Fix IndexCreationTool exiting with code 0 on signtool/makeappx failure#2

Closed
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-exit-code-on-error
Closed

Fix IndexCreationTool exiting with code 0 on signtool/makeappx failure#2
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-exit-code-on-error

Conversation

Copy link
Copy Markdown

Copilot AI commented May 31, 2026

📖 Description

IndexCreationTool was silently succeeding (exit code 0) even when signtool.exe or makeappx.exe failed. Helpers.RunCommand launched child processes but never checked their exit codes, so errors like SignTool Error: No certificates were found that met all the given criteria were printed to stdout but swallowed without throwing.

Changes:

  • RunCommand — checks p.ExitCode after WaitForExit() and throws if non-zero, causing the error to propagate up through CreatePackageCreateLocalSourceMain, which returns -1
  • Unpack — was inlining its own process-launch logic (also without exit code check); refactored to delegate to RunCommand

🔗 References

🔍 Validation

Verified by code inspection that all signtool/makeappx invocations route through RunCommand, and that Main catches any thrown exception and returns -1.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants