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

[File Explorer] Added an overall toggle switch (#23723) #33475

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7e4e12b
Added stuff for an enabled toggle
acekirkpatrick Jun 11, 2024
79919c9
Removed incorrect summary
acekirkpatrick Jun 12, 2024
2b513b6
Added most of a GPO
acekirkpatrick Jun 13, 2024
9dabee3
Added to BugReportTool
acekirkpatrick Jun 13, 2024
d6bd83b
Updated .adml and .admx
acekirkpatrick Jun 13, 2024
b65f633
Added a card to the Dashboard
acekirkpatrick Jun 13, 2024
a40d5c5
Fixed adml
acekirkpatrick Jun 17, 2024
cd3172c
Reordered things so File Explorer appears in the right place
acekirkpatrick Jun 17, 2024
40707c4
Finished copying from other modules
acekirkpatrick Jun 17, 2024
75e8ed9
Made sure it was using its own GPO
acekirkpatrick Jun 17, 2024
43074da
Allowed it to save the setting
acekirkpatrick Jun 18, 2024
877d12c
Disabled settings when module is not enabled
acekirkpatrick Jun 18, 2024
e5798ee
Reformatted .adml and .admx
acekirkpatrick Jun 21, 2024
9e85b63
Added a check to stop it from starting the handlers if the module is …
acekirkpatrick Jun 21, 2024
b35df52
Made sure enable() called apply_settings so that the modules start
acekirkpatrick Jun 21, 2024
f197ee3
Updated .adml and .admx
acekirkpatrick Jun 26, 2024
4f15ce6
Reordered .adml and .admx
acekirkpatrick Jun 26, 2024
7d1f213
Renamed File Previewer to File Explorer add-on
acekirkpatrick Jun 28, 2024
b905634
Improved C++ code
acekirkpatrick Jun 28, 2024
e3e9583
Hid the info bars when the module is disabled
acekirkpatrick Jun 28, 2024
1470338
Changed the dashboard text
acekirkpatrick Jun 28, 2024
4c42c90
Updated for consistent behavior
acekirkpatrick Jun 30, 2024
c9174f9
Stopped the global utility policy from affecting individual previewers
acekirkpatrick Jul 3, 2024
7a4052d
Turned off previewers if module is disabled
acekirkpatrick Jul 3, 2024
779214e
Updated .adml
acekirkpatrick Jul 3, 2024
115d3e8
Merge branch 'main' into 23723
jaimecbernardo Jul 22, 2024
9c83638
Update .adml for clarification
acekirkpatrick Jul 22, 2024
b31bcab
Update .adml for clarification
acekirkpatrick Jul 25, 2024
7f6ab6f
Updated version information in the .admx and .adml
acekirkpatrick Aug 8, 2024
893e5de
Updated .adml and .admx to version 0.85.0
acekirkpatrick Sep 4, 2024
34381ad
Change to revision comment
acekirkpatrick Sep 4, 2024
dc1746a
Merged main into 23723
acekirkpatrick Sep 4, 2024
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
4 changes: 4 additions & 0 deletions src/common/GPOWrapper/GPOWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,8 @@ namespace winrt::PowerToys::GPOWrapper::implementation
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteOnlineAIModelsValue());
}
GpoRuleConfigured GPOWrapper::GetConfiguredFileExplorerPreviewEnabledValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredFileExplorerPreviewEnabledValue());
}
}
1 change: 1 addition & 0 deletions src/common/GPOWrapper/GPOWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace winrt::PowerToys::GPOWrapper::implementation
static GpoRuleConfigured GetConfiguredQoiPreviewEnabledValue();
static GpoRuleConfigured GetConfiguredQoiThumbnailsEnabledValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOnlineAIModelsValue();
static GpoRuleConfigured GetConfiguredFileExplorerPreviewEnabledValue();
};
}

Expand Down
1 change: 1 addition & 0 deletions src/common/GPOWrapper/GPOWrapper.idl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ namespace PowerToys
static GpoRuleConfigured GetConfiguredQoiPreviewEnabledValue();
static GpoRuleConfigured GetConfiguredQoiThumbnailsEnabledValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOnlineAIModelsValue();
static GpoRuleConfigured GetConfiguredFileExplorerPreviewEnabledValue();
}
}
}
1 change: 1 addition & 0 deletions src/common/ManagedCommon/ModuleType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public enum ModuleType
CropAndLock,
EnvironmentVariables,
FancyZones,
PowerPreview,
FileLocksmith,
FindMyMouse,
Hosts,
Expand Down
12 changes: 9 additions & 3 deletions src/common/utils/gpo.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace powertoys_gpo {
const std::wstring POLICY_CONFIGURE_ENABLED_ENVIRONMENT_VARIABLES = L"ConfigureEnabledUtilityEnvironmentVariables";
const std::wstring POLICY_CONFIGURE_ENABLED_QOI_PREVIEW = L"ConfigureEnabledUtilityFileExplorerQOIPreview";
const std::wstring POLICY_CONFIGURE_ENABLED_QOI_THUMBNAILS = L"ConfigureEnabledUtilityFileExplorerQOIThumbnails";
const std::wstring POLICY_CONFIGURE_ENABLED_FILE_EXPLORER_PREVIEW = L"ConfigureEnabledUtilityFileExplorerPreview";

// The registry value names for PowerToys installer and update policies.
const std::wstring POLICY_DISABLE_PER_USER_INSTALLATION = L"PerUserInstallationDisabled";
Expand Down Expand Up @@ -422,7 +423,7 @@ namespace powertoys_gpo {
}

inline gpo_rule_configured_t getRunPluginEnabledValue(std::string pluginID)
{
{
if (pluginID == "" || pluginID == " ")
{
// this plugin id can't exist in the registry
Expand All @@ -431,7 +432,7 @@ namespace powertoys_gpo {

std::wstring plugin_id(pluginID.begin(), pluginID.end());
auto individual_plugin_setting = getPolicyListValue(POWER_LAUNCHER_INDIVIDUAL_PLUGIN_ENABLED_LIST_PATH, plugin_id);

if (individual_plugin_setting.has_value())
{
if (*individual_plugin_setting == L"0")
Expand All @@ -458,7 +459,7 @@ namespace powertoys_gpo {
{
// If no individual plugin policy exists, we check the policy with the setting for all plugins.
return getConfiguredValue(POLICY_CONFIGURE_ENABLED_POWER_LAUNCHER_ALL_PLUGINS);
}
}
}

inline gpo_rule_configured_t getConfiguredQoiPreviewEnabledValue()
Expand All @@ -475,4 +476,9 @@ namespace powertoys_gpo {
{
return getUtilityEnabledValue(POLICY_ALLOW_ADVANCED_PASTE_ONLINE_AI_MODELS);
}

inline gpo_rule_configured_t getConfiguredFileExplorerPreviewEnabledValue()
{
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_FILE_EXPLORER_PREVIEW);
}
}
60 changes: 37 additions & 23 deletions src/gpo/assets/PowerToys.admx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation.
Licensed under the MIT License. -->
<policyDefinitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="1.10" schemaVersion="1.0" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<policyDefinitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="1.11" schemaVersion="1.0" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<policyNamespaces>
<target prefix="powertoys" namespace="Microsoft.Policies.PowerToys" />
</policyNamespaces>
<resources minRequiredRevision="1.10"/><!-- Last changed with PowerToys v0.81.1 -->
<resources minRequiredRevision="1.11"/><!-- Last changed with PowerToys v0.83.0 -->
<supportedOn>
<definitions>
<definition name="SUPPORTED_POWERTOYS_0_64_0" displayName="$(string.SUPPORTED_POWERTOYS_0_64_0)"/>
Expand All @@ -19,6 +19,7 @@
<definition name="SUPPORTED_POWERTOYS_0_78_0" displayName="$(string.SUPPORTED_POWERTOYS_0_78_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_81_0" displayName="$(string.SUPPORTED_POWERTOYS_0_81_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_81_1" displayName="$(string.SUPPORTED_POWERTOYS_0_81_1)"/>
<definition name="SUPPORTED_POWERTOYS_0_83_0" displayName="$(string.SUPPORTED_POWERTOYS_0_83_0)"/>
</definitions>
</supportedOn>
<categories>
Expand All @@ -32,6 +33,9 @@
<category name="AdvancedPaste" displayName="$(string.AdvancedPaste)">
<parentCategory ref="PowerToys" />
</category>
<category name="FilePreviewers" displayName="$(string.FilePreviewers)">
<parentCategory ref="PowerToys" />
</category>
</categories>
<policies>

Expand Down Expand Up @@ -136,8 +140,18 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerSVGPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerSVGPreview)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerSVGPreview">
<policy name="ConfigureEnabledUtilityFileExplorerPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerPreview)" explainText="$(string.ConfigureEnabledUtilityDescriptionFileExplorerPreview)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerPreview">
<parentCategory ref="PowerToys" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_83_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerSVGPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerSVGPreview)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerSVGPreview">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -146,8 +160,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerMarkdownPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerMarkdownPreview)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerMarkdownPreview">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerMarkdownPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerMarkdownPreview)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerMarkdownPreview">
<parentCategory ref="FilePreviewers" />
Copy link
Collaborator

@htcfreek htcfreek Jun 27, 2024

Choose a reason for hiding this comment

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

@acekirkpatrick
Should be File Explorer add-ons.

@jaimecbernardo
Can move the policies into the sub category, even if it breake existing Intune policy configuration sets? (Normal Group Policy configuration won't break.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure. Think we might need to add a note about that in release notes. we also broke "All utitilities" GPO backcompatibility in Intune. Not sure why Intune needs to be different 🤷

Copy link
Collaborator

@htcfreek htcfreek Jul 22, 2024

Choose a reason for hiding this comment

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

Not sure. Think we might need to add a note about that in release notes. we also broke "All utitilities" GPO backcompatibility in Intune. Not sure why Intune needs to be different 🤷

Side note: And All Experiments GPO is broken too after mofing into sub category. (PR 33529)

<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -156,8 +170,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerMonacoPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerMonacoPreview)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerMonacoPreview">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerMonacoPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerMonacoPreview)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerMonacoPreview">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -166,8 +180,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerPDFPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerPDFPreview)" explainText="$(string.ConfigureEnabledUtilityDescriptionPDFPreviewHandler)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerPDFPreview">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerPDFPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerPDFPreview)" explainText="$(string.ConfigureEnabledFilePreviewerDescriptionPDFPreviewHandler)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerPDFPreview">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -176,8 +190,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerGcodePreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerGcodePreview)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerGcodePreview">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerGcodePreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerGcodePreview)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerGcodePreview">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -186,8 +200,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerSVGThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerSVGThumbnails)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerSVGThumbnails">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerSVGThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerSVGThumbnails)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerSVGThumbnails">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -196,8 +210,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerPDFThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerPDFThumbnails)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerPDFThumbnails">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerPDFThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerPDFThumbnails)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerPDFThumbnails">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -206,8 +220,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerGcodeThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerGcodeThumbnails)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerGcodeThumbnails">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerGcodeThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerGcodeThumbnails)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerGcodeThumbnails">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -216,8 +230,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerQOIPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerQOIPreview)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerQOIPreview">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerQOIPreview" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerQOIPreview)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerQOIPreview">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_76_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -226,8 +240,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerQOIThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerQOIThumbnails)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerQOIThumbnails">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerQOIThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerQOIThumbnails)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerQOIThumbnails">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_76_0" />
<enabledValue>
<decimal value="1" />
Expand All @@ -236,8 +250,8 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityFileExplorerSTLThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerSTLThumbnails)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerSTLThumbnails">
<parentCategory ref="PowerToys" />
<policy name="ConfigureEnabledUtilityFileExplorerSTLThumbnails" class="Both" displayName="$(string.ConfigureEnabledUtilityFileExplorerSTLThumbnails)" explainText="$(string.ConfigureEnabledFilePreviewerDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityFileExplorerSTLThumbnails">
<parentCategory ref="FilePreviewers" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_64_0" />
<enabledValue>
<decimal value="1" />
Expand Down
Loading
Loading