-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support winget installing AppInstaller #3377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Contributor
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JohnMcPMS
reviewed
Jul 5, 2023
This comment has been minimized.
This comment has been minimized.
JohnMcPMS
approved these changes
Jul 8, 2023
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.
Change
When winget is updating AppInstaller (aka. itself) via
winget install 9NBLGGH4NNS1 -s msstore --forceif appears the installation failed but in reality, it got updated successfully.The failure means
ERROR_PACKAGES_IN_USEand from my last PR #3299 I believe that error will go away because of--force, but a new one will occur. I need a real AppInstaller package to confirm this but because reasons I cannot build it right now. Regardless, the correct fix it to listen to messages from the lifetime manager.When the system is updating an app, the app lifetime manager will ask any the app to terminate if its running. It does it by:
This means that winget.exe needs to start listening to window messages because there's no real difference between the app lifetime manager and a user doing CTRL-C. This PR creates a hidden window and start the message loop. When WM_QUERYENDSESSION is received, we will ask to cancel any progress (as it currently does with CTRL-C) stating the reason as AppShutdown. By design, we are not going to cancel installations as maybe they get completed before they terminate us. Any other operation will be cancelled.
If the context gets cancelled with an AppShutdown reason while installing AppInstaller we will just set the progress as 100% and be done with it as we are going to get terminated soon.
pie title Progress of AppInstaller installation by winget "Real" : 9 "Fake" : 1Validation
I created a new
winget test appshutdowncommand that will verify the window handle is correct and the app shutdown event is signaled. The E2E test will run this command and reregister wingetdev to generate the message as deployment would do. I still need a real AppInstaller package to make sure the flow works as I expect.Microsoft Reviewers: codeflow:open?pullrequest=#3377