Fix signaling the app shutdown event running as admin #3874
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.
There's bug in the OS where the WM_QUERYENDSESSION message is not send when a package is being updated if the package is running elevated. This makes
winget configure --enable
to stop at 95% and eventually get terminated by the system for an update. The update is successful, but the experience is not the best. It also makes it harder to useIConfigurationStatics::IConfigurationStatics
in an elevated context.The fix is to use the
PackageCatalog
APIs and register forPackageUpdating
events when winget is running elevated and in a package context and signal the competition event if the progress is more than 0. Otherwise create the window and listen to messages.Enable test where a new update is being registered since now it will work and move test to force the WM_QUERYENDSESSION to UTs
Microsoft Reviewers: Open in CodeFlow