winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Expose Agreements and Locale Fields in COM

Open ryfu-msft opened this issue 2 years ago • 0 comments

The changes in this PR expose all of the locale fields including agreements. Also provides a way for the COM caller to accept or reject package/source agreements. To avoid breaking existing usage, the default behavior for accepting source/package agreements has been set to true.

Changes:

  • Modifies InstallOptions to expose AcceptPackageAgreements(bool)
  • Modifies PackageCatalogReference to expose AcceptSourceAgreements(bool)
  • Modifies PackageVersionInfo to expose two methods for obtaining a CatalogPackageMetadata object which contains the locale fields (including agreements). GetCatalogPackageMetadata() with no parameters uses the default localization, while GetCatalogPackageMetadata(string locale) applies the specified locale and retrieves those locale fields. Tests:

Added tests to verify that all locale fields and agreements are outputted correctly.

ryfu-msft avatar Jan 31 '23 18:01 ryfu-msft