Skip to content
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

Fix GetFullNameFromFamilyName for non-elevated context #2922

Merged
merged 2 commits into from Feb 6, 2023

Conversation

yao-msft
Copy link
Contributor

@yao-msft yao-msft commented Feb 4, 2023

PackageManager.FindPackages requires elevated context, the fix will be to revert to use previous FindPackagesByPackageFamily

Microsoft Reviewers: Open in CodeFlow

@yao-msft yao-msft requested a review from a team as a code owner February 4, 2023 01:05
@@ -367,21 +368,59 @@ namespace AppInstaller::Msix
PackageManager packageManager;

std::wstring pfn = Utility::ConvertToUTF16(familyName);
auto packages = packageManager.FindPackages(pfn);
if (Runtime::IsRunningAsAdmin())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we add a comment about why this check is needed?

{
// More than 1 package found. Don't directly error, let caller deal with it.
// Don't directly error, let caller deal with it
AICLI_LOG(Core, Error, << "Multiple packages found for family name: " << fullNameCount);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we also log something like this in the other case?

@yao-msft yao-msft merged commit 665ddd9 into microsoft:master Feb 6, 2023
@yao-msft yao-msft deleted the fixfindpackagenonelevated branch February 6, 2023 19:53
@yao-msft yao-msft linked an issue Feb 6, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to uninstall a provisioned MSIX package non-elevated
3 participants