Skip to content

Poll for the result of operations during MSI installation - #41415

Merged
Blue (OneBlue) merged 2 commits into
masterfrom
user/oneblue/msi-crash-fix
Aug 21, 2026
Merged

Poll for the result of operations during MSI installation#41415
Blue (OneBlue) merged 2 commits into
masterfrom
user/oneblue/msi-crash-fix

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change updates the custom action logic to poll for the completion of appx operations during the MSI installations.

Calling .get() registers a delegate that, due to a cppwinrt lifetime issue, might not get released until wslinstall.dll is unloaded, causing a crash since the release will jump into unloaded code.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI lite review requested due to automatic review settings August 21, 2026 21:46
@OneBlue
Blue (OneBlue) requested a review from a team as a code owner August 21, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates MSI custom action logic to poll AppX operations safely, avoiding delegate lifetime issues during DLL unloading.

Changes:

  • Adds polling-based operation waiting and cleanup.
  • Handles error and canceled states.
  • Updates deprovisioning and error paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@benhillis Ben Hillis (benhillis) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely seems like a cpp / winrt bug, hopefully we can get a fix or better guidance from them.

@OneBlue
Blue (OneBlue) merged commit 7808450 into master Aug 21, 2026
12 checks passed
@OneBlue
Blue (OneBlue) deleted the user/oneblue/msi-crash-fix branch August 21, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants