From a36a63286d106c8c35557f307e5df8abc5ebdf1c Mon Sep 17 00:00:00 2001 From: yao-msft <50888816+yao-msft@users.noreply.github.com> Date: Mon, 2 Oct 2023 19:21:02 -0700 Subject: [PATCH] Platform source should not be blocked by policy check (#3725) --- src/AppInstallerCLITests/Sources.cpp | 6 ++++++ src/AppInstallerRepositoryCore/SourcePolicy.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/AppInstallerCLITests/Sources.cpp b/src/AppInstallerCLITests/Sources.cpp index f35ea9ed45..e0f4473365 100644 --- a/src/AppInstallerCLITests/Sources.cpp +++ b/src/AppInstallerCLITests/Sources.cpp @@ -1294,3 +1294,9 @@ TEST_CASE("RepoSources_GroupPolicy_BypassCertificatePinningForMicrosoftStore", " REQUIRE_FALSE(source.GetDetails().CertificatePinningConfiguration.IsEmpty()); } } + +TEST_CASE("RepoSources_BuiltInDesktopFrameworkSourceAlwaysCreatable", "[sources]") +{ + Source source(WellKnownSource::DesktopFrameworks); + REQUIRE(source); +} \ No newline at end of file diff --git a/src/AppInstallerRepositoryCore/SourcePolicy.cpp b/src/AppInstallerRepositoryCore/SourcePolicy.cpp index a5324d1226..84a1859b0a 100644 --- a/src/AppInstallerRepositoryCore/SourcePolicy.cpp +++ b/src/AppInstallerRepositoryCore/SourcePolicy.cpp @@ -173,6 +173,9 @@ namespace AppInstaller::Repository return IsDefaultSourceEnabled(source, ExperimentalFeature::Feature::None, onlyExplicit, TogglePolicy::Policy::DefaultSource); case AppInstaller::Repository::WellKnownSource::MicrosoftStore: return IsDefaultSourceEnabled(source, ExperimentalFeature::Feature::None, onlyExplicit, TogglePolicy::Policy::MSStoreSource); + case AppInstaller::Repository::WellKnownSource::DesktopFrameworks: + // No corresponding policy available for this source. + return true; } return false;