Repository navigation
Refresh the WinGet COM installed index before listing local packages - #5585
Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intoOct 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The workaround relies on cross-process registry notifications and still needs validation against a real MSIX upgrade in the running Windows app.
No open issues 🎉
What changed in this PR
This PR addresses stale MSIX versions in UniGetUI’s native WinGet backend by triggering an installed-index refresh before local package enumeration.
Changes:
- Sets and deletes a temporary value on the per-user Uninstall registry key to notify the WinGet COM server.
- Logs missing-key or write failures and continues enumeration.
- Leaves CLI, Pinget, and UniGetUI’s separate 15-second cache unchanged.
| File | Description |
|---|---|
| src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/NativeWinGetHelper.cs | Adds best-effort registry-based cache invalidation before native local package queries. |
Review effort: Balanced
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "e12cfdc0-cee9-11f1-9196-49eebeebbfd3",
"headSha": "327657ca10fb4ba25aaf3b3faccb9c59550e9cef",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
Gabriel Dufresne (GabrielDuf)
deleted the
fix/winget-com-stale-msix-versions
branch
October 23, 2026 14:26
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.
Why
With the default native WinGet backend (COM API), an MSIX package that was just updated keeps showing its old version and keeps being offered as an update. Running that update again then fails with
0x8A15002B("No newer package versions are available"). This affects Oh My Posh, NanaZip, Command Palette extensions and other MSIX packages, whether UniGetUI or the Microsoft Store did the update. Packages installed with a classic installer are unaffected, and so are the WinGet CLI and Pinget.The stale data comes from the WinGet COM server, which is why the template box above is left unchecked. The server keeps a process-wide cache of installed packages (
CachedInstalledIndexin winget-cli'sPredefinedInstalledSourceFactory.cpp, identical in v1.29.280 and in the 1.12.350 interop this repo uses). It rebuilds that cache only when:PackageCatalog.PackageStatusChangedfires.An MSIX install, upgrade or removal done outside the server does neither. That covers
winget.exe, which UniGetUI runs for operations, and Store auto-updates. So the COM listing stays stale for as long as the server process lives. Any long-lived COM client keeps the server alive: UniGetUI itself, or PowerToys Command Palette. That's why Reset WinGet (which killsWindowsPackageManagerServer.exe) helped only once. The CLI and Pinget are fine because each call is a fresh process.The cache is used only for the default
InstalledScope, and the COM API offers no way to force a refresh (InstalledForceCacheUpdateis CLI-only). No upstream fix is expected, so UniGetUI has to work around it.What changed (
NativeWinGetHelper.cs)Before each local package enumeration,
GetLocalWinGetPackagesnow sets and immediately deletes a value onHKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall. The server's recursive ARP registry watcher sees the change and rebuilds the index on the next connect. This is the same refresh a classic install already triggers.Rejected alternatives:
Verification
PackageManageralive while a throwaway loose-file MSIX was registered, updated (1.0.0.0 → 1.0.1.0) and removed.dotnet format whitespaceanddotnet format styleboth exit 0 with--verify-no-changes.UniGetUI.PackageEngine.Testsproject passes.Closes #5188