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

Add product code and PFN to enable existing searches #1677

Merged
merged 2 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Microsoft.Management.Deployment/Converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ namespace winrt::Microsoft::Management::Deployment::implementation
case ::AppInstaller::Repository::PackageMatchField::Tag:
matchField = Microsoft::Management::Deployment::PackageMatchField::Tag;
break;
case ::AppInstaller::Repository::PackageMatchField::ProductCode:
matchField = Microsoft::Management::Deployment::PackageMatchField::ProductCode;
break;
case ::AppInstaller::Repository::PackageMatchField::PackageFamilyName:
matchField = Microsoft::Management::Deployment::PackageMatchField::PackageFamilyName;
break;
default:
matchField = Microsoft::Management::Deployment::PackageMatchField::Id;
break;
Expand Down Expand Up @@ -56,6 +62,12 @@ namespace winrt::Microsoft::Management::Deployment::implementation
case Microsoft::Management::Deployment::PackageMatchField::Tag:
matchField = ::AppInstaller::Repository::PackageMatchField::Tag;
break;
case Microsoft::Management::Deployment::PackageMatchField::ProductCode:
matchField = ::AppInstaller::Repository::PackageMatchField::ProductCode;
break;
case Microsoft::Management::Deployment::PackageMatchField::PackageFamilyName:
matchField = ::AppInstaller::Repository::PackageMatchField::PackageFamilyName;
break;
default:
matchField = ::AppInstaller::Repository::PackageMatchField::Id;
break;
Expand Down
9 changes: 6 additions & 3 deletions src/Microsoft.Management.Deployment/PackageManager.idl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.
namespace Microsoft.Management.Deployment
{
[contractversion(2)]
[contractversion(3)]
apicontract WindowsPackageManagerContract{};

/// State of the install.
Expand Down Expand Up @@ -283,9 +283,12 @@ namespace Microsoft.Management.Deployment
Moniker,
Command,
Tag,
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 3)]
{
PackageFamilyName,
ProductCode,
}
/// DESIGN NOTE: The following PackageFieldMatchOption from winget/RepositorySearch.h are not implemented in V1.
/// PackageFamilyName,
/// ProductCode,
/// NormalizedNameAndPublisher,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="packageQuery" />
Copy link
Contributor

Choose a reason for hiding this comment

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

packageQuery

packageManagement should already include packageQuery in semantics, did you find places that only work with packageQuery but not packageManagement? If yes, we may need to fix those.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, it looks like the code is doing that and I was just seeing the failure to directly find packageQuery while debugging. I can revert this and update the code to not log a failure here.

<rescap:Capability Name="packageManagement" />
</Capabilities>
</Package>