More graceful MSIX enumeration failure handling#5329
Conversation
| { | ||
| try | ||
| { | ||
| packages = packageManager.FindPackagesForUserWithPackageTypes({}, types); |
There was a problem hiding this comment.
if Main | Framework failed, does enumerating Main and Framework individually and combining the results work?
There was a problem hiding this comment.
My assumption is that this issue is caused by some package's state being corrupted. Hopefully if it is just one package, then it must either be a Main OR a Framework. Attempting to get that one will also fail, and we can enumerate the other list. But this is all speculation on the actual issue.
A MUCH larger change would surface this inability to enumerate the packages and allow the code with context to decide how to proceed like we do with the errors from available catalogs. But on thinking through the implications here, I think it is better to allow reduced functionality rather than hard error. In the cases where it matters, it probably means doing extra work. In the cases where it doesn't matter, it means success instead of the current error.
Fixes #5318
Mitigates many other issues getting 0x80070490 from installed package enumeration
Change
Check for
IPackageManager9before using it to prevent an AV on older Windows versions.Attempt to
FindPackagesForUserWithPackageTypeswith fewer types if it fails withE_NOT_SET. While this is an OS issue, enumerating fewer (or no) packages is generally better than an error that completely blocks usage.Validation
Manually tried both user and system scopes to ensure proper mainline functionality.
Microsoft Reviewers: Open in CodeFlow