diff --git a/doc/gpo/README.md b/doc/gpo/README.md index 482c3f6271..929708265f 100644 --- a/doc/gpo/README.md +++ b/doc/gpo/README.md @@ -31,3 +31,11 @@ If you enable this setting, the utility will be always enabled and the user won' If you disable this setting, the utility will be always disabled and the user won't be able to enable it. If you don't configure this setting, users are able to disable or enable the utility. + +### Allow experimentation + +This policy configures whether PowerToys experimentation is allowed. + +Disable this setting to disable the experimentation features in PowerToys, meaning the user won't see the new features being experimented even if it gets selected as part of the test group. + +If this setting is not configured, experimentation is allowed. diff --git a/src/common/GPOWrapper/GPOWrapper.cpp b/src/common/GPOWrapper/GPOWrapper.cpp index 08948db0d1..eb813ab616 100644 --- a/src/common/GPOWrapper/GPOWrapper.cpp +++ b/src/common/GPOWrapper/GPOWrapper.cpp @@ -112,4 +112,8 @@ namespace winrt::PowerToys::GPOWrapper::implementation { return static_cast(powertoys_gpo::getConfiguredVideoConferenceMuteEnabledValue()); } + GpoRuleConfigured GPOWrapper::GetAllowExperimentationValue() + { + return static_cast(powertoys_gpo::getAllowExperimentationValue()); + } } diff --git a/src/common/GPOWrapper/GPOWrapper.h b/src/common/GPOWrapper/GPOWrapper.h index 25b8d87445..da74b912d8 100644 --- a/src/common/GPOWrapper/GPOWrapper.h +++ b/src/common/GPOWrapper/GPOWrapper.h @@ -34,6 +34,7 @@ namespace winrt::PowerToys::GPOWrapper::implementation static GpoRuleConfigured GetConfiguredShortcutGuideEnabledValue(); static GpoRuleConfigured GetConfiguredTextExtractorEnabledValue(); static GpoRuleConfigured GetConfiguredVideoConferenceMuteEnabledValue(); + static GpoRuleConfigured GetAllowExperimentationValue(); }; } diff --git a/src/common/GPOWrapper/GPOWrapper.idl b/src/common/GPOWrapper/GPOWrapper.idl index f316b63fe1..5e6deef6d7 100644 --- a/src/common/GPOWrapper/GPOWrapper.idl +++ b/src/common/GPOWrapper/GPOWrapper.idl @@ -38,6 +38,7 @@ namespace PowerToys static GpoRuleConfigured GetConfiguredShortcutGuideEnabledValue(); static GpoRuleConfigured GetConfiguredTextExtractorEnabledValue(); static GpoRuleConfigured GetConfiguredVideoConferenceMuteEnabledValue(); + static GpoRuleConfigured GetAllowExperimentationValue(); } } } diff --git a/src/common/utils/gpo.h b/src/common/utils/gpo.h index 6c02e2b159..ee887c60ea 100644 --- a/src/common/utils/gpo.h +++ b/src/common/utils/gpo.h @@ -46,6 +46,7 @@ namespace powertoys_gpo { const std::wstring POLICY_CONFIGURE_ENABLED_SHORTCUT_GUIDE = L"ConfigureEnabledUtilityShortcutGuide"; const std::wstring POLICY_CONFIGURE_ENABLED_TEXT_EXTRACTOR = L"ConfigureEnabledUtilityTextExtractor"; const std::wstring POLICY_CONFIGURE_ENABLED_VIDEO_CONFERENCE_MUTE = L"ConfigureEnabledUtilityVideoConferenceMute"; + const std::wstring POLICY_ALLOW_EXPERIMENTATION = L"AllowExperimentation"; inline gpo_rule_configured_t getConfiguredValue(const std::wstring& registry_value_name) { @@ -235,4 +236,9 @@ namespace powertoys_gpo { return getConfiguredValue(POLICY_CONFIGURE_ENABLED_VIDEO_CONFERENCE_MUTE); } + inline gpo_rule_configured_t getAllowExperimentationValue() + { + return getConfiguredValue(POLICY_ALLOW_EXPERIMENTATION); + } + } diff --git a/src/gpo/assets/PowerToys.admx b/src/gpo/assets/PowerToys.admx index 037bf1cc2d..00b0bb2b9d 100644 --- a/src/gpo/assets/PowerToys.admx +++ b/src/gpo/assets/PowerToys.admx @@ -1,14 +1,15 @@ - + - + + @@ -286,5 +287,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/gpo/assets/en-US/PowerToys.adml b/src/gpo/assets/en-US/PowerToys.adml index 9a07cd42f9..17c379b691 100644 --- a/src/gpo/assets/en-US/PowerToys.adml +++ b/src/gpo/assets/en-US/PowerToys.adml @@ -1,7 +1,7 @@ - + PowerToys PowerToys @@ -9,6 +9,7 @@ Microsoft PowerToys PowerToys version 0.64.0 or later + PowerToys version 0.68.0 or later This policy configures the enabled state for a PowerToys utility. @@ -27,6 +28,12 @@ If you enable this setting, the utility will be always enabled and the user won' If you disable this setting, the utility will be always disabled and the user won't be able to enable it. If you don't configure this setting, users are able to disable or enable the utility. + + This policy configures whether PowerToys experimentation is allowed. With experimentation allowed the user sees the new features being experimented if it gets selected as part of the test group. (Experimentation will only happen on Windows Insider builds.) + +If this setting is not configured or enabled, the user can control experimentation in the PowerToys settings menu. + +If this setting is disabled, experimentation is not allowed. Always On Top: Configure enabled state Awake: Configure enabled state @@ -55,6 +62,7 @@ If you don't configure this setting, users are able to disable or enable the uti Shortcut Guide: Configure enabled state Text Extractor: Configure enabled state Video Conference Mute: Configure enabled state + Allow Experimentation diff --git a/src/settings-ui/Settings.UI/OOBE/Views/OobeShellPage.xaml.cs b/src/settings-ui/Settings.UI/OOBE/Views/OobeShellPage.xaml.cs index 05498bd208..1c14f8db23 100644 --- a/src/settings-ui/Settings.UI/OOBE/Views/OobeShellPage.xaml.cs +++ b/src/settings-ui/Settings.UI/OOBE/Views/OobeShellPage.xaml.cs @@ -6,6 +6,7 @@ using System; using System.Collections.ObjectModel; using System.Globalization; using AllExperiments; +using global::PowerToys.GPOWrapper; using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.PowerToys.Settings.UI.OOBE.Enums; using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel; @@ -195,7 +196,7 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views switch (selectedItem.Tag) { case "Overview": - if (ExperimentationToggleSwitchEnabled) + if (ExperimentationToggleSwitchEnabled && GPOWrapper.GetAllowExperimentationValue() != GpoRuleConfigured.Disabled) { switch (AllExperiments.Experiments.LandingPageExperiment) { diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index c397cbcbd8..08e32c0970 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -2922,11 +2922,17 @@ Activate by holding the key for the character you want to add an accent to, then PowerToys Run + + Experimentation + - Only affects Windows Insider builds + Note: Only Windows Insider builds may be selected for experimentation - Enable experimentation + Allow experimentation with new features + + + The system administrator has disabled experimentation. All apps diff --git a/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs index babf4e0158..9876249c10 100644 --- a/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs @@ -12,6 +12,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Text.Json; using System.Threading.Tasks; +using global::PowerToys.GPOWrapper; using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.PowerToys.Settings.UI.Library.Helpers; using Microsoft.PowerToys.Settings.UI.Library.Interfaces; @@ -140,6 +141,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels _newAvailableVersionLink = UpdatingSettingsConfig.ReleasePageLink; _updateCheckedDate = UpdatingSettingsConfig.LastCheckedDateLocalized; + _experimentationIsGpoDisallowed = GPOWrapper.GetAllowExperimentationValue() == GpoRuleConfigured.Disabled; + if (dispatcherAction != null) { _fileWatcher = Helper.GetFileWatcher(string.Empty, UpdatingSettings.SettingsFile, dispatcherAction); @@ -154,6 +157,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels private bool _autoDownloadUpdates; private bool _enableExperimentation; + private bool _experimentationIsGpoDisallowed; private UpdatingSettings.UpdatingState _updatingState = UpdatingSettings.UpdatingState.UpToDate; private string _newAvailableVersion = string.Empty; @@ -290,7 +294,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return _enableExperimentation; + return _enableExperimentation && !_experimentationIsGpoDisallowed; } set @@ -304,6 +308,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels } } + public bool IsExperimentationGpoDisallowed + { + get => _experimentationIsGpoDisallowed; + } + public static bool AutoUpdatesEnabled { get diff --git a/src/settings-ui/Settings.UI/Views/GeneralPage.xaml b/src/settings-ui/Settings.UI/Views/GeneralPage.xaml index 7ac95c8537..1918c0ec0e 100644 --- a/src/settings-ui/Settings.UI/Views/GeneralPage.xaml +++ b/src/settings-ui/Settings.UI/Views/GeneralPage.xaml @@ -369,12 +369,6 @@ - - - + + + + + +