diff --git a/omaha/common/config_manager.cc b/omaha/common/config_manager.cc index d10fc6830..0a0032bef 100644 --- a/omaha/common/config_manager.cc +++ b/omaha/common/config_manager.cc @@ -414,8 +414,17 @@ ConfigManager::ConfigManager() : dm_policy_manager_(new DMPolicyManager) { true) == 0) : false; - policies_.emplace_back(new GroupPolicyManager); - policies_.push_back(dm_policy_manager_); + DWORD cloud_policy_preferred(0); + if (SUCCEEDED(RegKey::GetValue(kRegKeyGoopdateGroupPolicy, + kRegValueCloudPolicyOverridesPlatformPolicy, + &cloud_policy_preferred)) && + cloud_policy_preferred) { + policies_.push_back(dm_policy_manager_); + policies_.emplace_back(new GroupPolicyManager); + } else { + policies_.emplace_back(new GroupPolicyManager); + policies_.push_back(dm_policy_manager_); + } } CString ConfigManager::GetUserDownloadStorageDir() const { diff --git a/omaha/common/const_group_policy.h b/omaha/common/const_group_policy.h index 715c060b8..29c85efaa 100644 --- a/omaha/common/const_group_policy.h +++ b/omaha/common/const_group_policy.h @@ -50,6 +50,8 @@ const TCHAR* const kRegValueUpdatesSuppressedStartMin = _T("UpdatesSuppressedStartMin"); const TCHAR* const kRegValueUpdatesSuppressedDurationMin = _T("UpdatesSuppressedDurationMin"); +const TCHAR* const kRegValueCloudPolicyOverridesPlatformPolicy = + _T("CloudPolicyOverridesPlatformPolicy"); // This policy specifies what kind of download URLs could be returned to the // client in the update response and in which order of priority. The client diff --git a/omaha/net/network_config.cc b/omaha/net/network_config.cc index 86bda8e15..ce5e269b2 100644 --- a/omaha/net/network_config.cc +++ b/omaha/net/network_config.cc @@ -134,8 +134,19 @@ HRESULT NetworkConfig::Initialize() { } Add(new UpdateDevProxyDetector); - Add(new GroupPolicyProxyDetector); - Add(new DMProxyDetector); + + DWORD cloud_policy_preferred(0); + if (SUCCEEDED(RegKey::GetValue(kRegKeyGoopdateGroupPolicy, + kRegValueCloudPolicyOverridesPlatformPolicy, + &cloud_policy_preferred)) && + cloud_policy_preferred) { + Add(new DMProxyDetector); + Add(new GroupPolicyProxyDetector); + } else { + Add(new GroupPolicyProxyDetector); + Add(new DMProxyDetector); + } + Add(new IEWPADProxyDetector); Add(new IEPACProxyDetector); Add(new IENamedProxyDetector);