Skip to content

Release COM DLLs before installer test MSI operations#40093

Merged
benhillis merged 2 commits intofeature/wsl-for-appsfrom
user/benhill/CoFreeUnusedLibrariesEx
Apr 3, 2026
Merged

Release COM DLLs before installer test MSI operations#40093
benhillis merged 2 commits intofeature/wsl-for-appsfrom
user/benhill/CoFreeUnusedLibrariesEx

Conversation

@benhillis
Copy link
Copy Markdown
Member

This is a follow-up to #40080 to resolve a test failure on older Windows OS versions.

Call CoFreeUnusedLibrariesEx before each msiexec invocation. This releases in-process COM DLLs like wslserviceproxystub.dll loaded by prior test classes, preventing the Restart Manager from detecting the test process as holding file locks and being terminated.

Ben Hillis added 2 commits April 2, 2026 18:13
Add PrepareForMsiOperation() that calls CoFreeUnusedLibrariesEx(0)
before each msiexec invocation. This releases in-process COM DLLs
like wslserviceproxystub.dll loaded by prior test classes, preventing
the Restart Manager from detecting the test process as holding file
locks and failing the install on older Server SKUs like ni_release.
@benhillis benhillis requested a review from a team as a code owner April 3, 2026 13:40
Copilot AI review requested due to automatic review settings April 3, 2026 13:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows installer test suite to proactively unload unused in-proc COM servers before invoking msiexec, mitigating Restart Manager “file-in-use” detection that can terminate the test process on older Windows/Server SKUs.

Changes:

  • Added a helper (PrepareForMsiOperation) that calls CoFreeUnusedLibrariesEx(0, 0) to release unused in-process COM DLLs.
  • Invoked this helper before MSI install/uninstall operations and before installing a downloaded GitHub release when the asset is an .msi.

@benhillis benhillis merged commit d7828e8 into feature/wsl-for-apps Apr 3, 2026
11 checks passed
benhillis added a commit that referenced this pull request Apr 3, 2026
* Release COM DLLs before installer test MSI operations

Add PrepareForMsiOperation() that calls CoFreeUnusedLibrariesEx(0)
before each msiexec invocation. This releases in-process COM DLLs
like wslserviceproxystub.dll loaded by prior test classes, preventing
the Restart Manager from detecting the test process as holding file
locks and failing the install on older Server SKUs like ni_release.

* fix CoFreeUnusedLibrariesEx

---------

Co-authored-by: Ben Hillis <[email protected]>
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.

4 participants