Repository navigation
Address non-interactive MSIX uninstall 0x80070520 (#6579) - #6597
Open
Bearmancer wants to merge 3 commits into
Open
Bearmancer wants to merge 3 commits into
Bearmancer wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
Author
|
@microsoft-github-policy-service agree |
Author
|
@microsoft-github-policy-service agree |
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.
📖 Description
When running
winget uninstall <package>for an MSIX/Store package from a non-interactive session (Session 0: SSH, WinRM, background agent, CI),Deployment::RemovePackagecallsPackageManager::RemovePackageAsync, which fails with0x80070520 : A specified logon session does not exist. It may already have been terminated.— the AppX deployment broker requires an interactive logon session when the call is issued from a packaged context.This change makes the MSIX uninstall path resilient in that situation:
Deployment::RemovePackagenow inspects the deployment result instead of unconditionally rethrowing. OnERROR_NO_SUCH_LOGON_SESSIONit treats the removal as successful when the package is no longer registered for the user, and otherwise falls back to an unpackagedRemove-AppxPackageinvocation (hidden window, bounded wait), re-checking registration afterwards.UninstallFlowno longer reports a false failure for0x80070520when the package family is not registered for the user; it logs the condition and continues.🔗 References
Fixes #6579
🔍 Validation
UninstallFlow_MSIXUninstall_NonInteractiveSessionNoError.✅ Checklist
🤖 AI Assistance
📋 Issue Type