Skip to content

Commit

Permalink
Remove disable per-machine policy
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Mar 31, 2023
1 parent a171e1d commit 5c6392c
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 42 deletions.
8 changes: 0 additions & 8 deletions doc/gpo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ If this setting is not configured, experimentation is allowed.

### Installer and Updates

#### Disable per-machine installation

This policy configures whether PowerToys per-machine installation is allowed or not.

If enabled, per-machine installation is not allowed.

If disabled or not configured, per-machine installation is allowed.

#### Disable per-user installation

This policy configures whether PowerToys per-user installation is allowed or not.
Expand Down
10 changes: 0 additions & 10 deletions installer/PowerToysSetupCustomActions/CustomAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ UINT __stdcall CheckGPOCA(MSIHANDLE hInstall)
hr = E_ABORT;
}
}
if(std::wstring{ currentScope } == L"perMachine")
{
if (powertoys_gpo::getDisablePerMachineInstallationValue() == powertoys_gpo::gpo_rule_configured_enabled)
{
PMSIHANDLE hRecord = MsiCreateRecord(0);
MsiRecordSetString(hRecord, 0, TEXT("The system administrator has disabled per-machine installation."));
MsiProcessMessage(hInstall, static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_ERROR + MB_OK), hRecord);
hr = E_ABORT;
}
}

LExit:
UINT er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
Expand Down
6 changes: 0 additions & 6 deletions src/common/utils/gpo.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace powertoys_gpo {
const std::wstring POLICY_CONFIGURE_ENABLED_REGISTRY_PREVIEW = L"ConfigureEnabledUtilityRegistryPreview";

// The registry value names for PowerToys installer and update policies.
const std::wstring POLICY_DISABLE_PER_MACHINE_INSTALLATION = L"PerMachineInstallationDisabled";
const std::wstring POLICY_DISABLE_PER_USER_INSTALLATION = L"PerUserInstallationDisabled";
const std::wstring POLICY_DISABLE_AUTOMATIC_UPDATE_DOWNLOAD = L"AutomaticUpdateDownloadDisabled";
const std::wstring POLICY_SUSPEND_NEW_UPDATE_TOAST = L"SuspendNewUpdateAvailableToast";
Expand Down Expand Up @@ -263,11 +262,6 @@ namespace powertoys_gpo {
return getConfiguredValue(POLICY_CONFIGURE_ENABLED_REGISTRY_PREVIEW);
}

inline gpo_rule_configured_t getDisablePerMachineInstallationValue()
{
return getConfiguredValue(POLICY_DISABLE_PER_MACHINE_INSTALLATION);
}

inline gpo_rule_configured_t getDisablePerUserInstallationValue()
{
return getConfiguredValue(POLICY_DISABLE_PER_USER_INSTALLATION);
Expand Down
12 changes: 1 addition & 11 deletions src/gpo/assets/PowerToys.admx
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,7 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="DisablePerMachineInstallation" class="Both" displayName="$(string.DisablePerMachineInstallation)" explainText="$(string.DisablePerMachineInstallationDescription)" key="Software\Policies\PowerToys" valueName="PerMachineInstallationDisabled">
<parentCategory ref="InstallerUpdates" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_69_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="DisablePerUserInstallation" class="Both" displayName="$(string.DisablePerUserInstallation)" explainText="$(string.DisablePerUserInstallationDescription)" key="Software\Policies\PowerToys" valueName="PerUserInstallationDisabled">
<policy name="DisablePerUserInstallation" class="Machine" displayName="$(string.DisablePerUserInstallation)" explainText="$(string.DisablePerUserInstallationDescription)" key="Software\Policies\PowerToys" valueName="PerUserInstallationDisabled">
<parentCategory ref="InstallerUpdates" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_69_0" />
<enabledValue>
Expand Down
7 changes: 0 additions & 7 deletions src/gpo/assets/en-US/PowerToys.adml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ 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.
</string>
<string id="DisablePerMachineInstallationDescription">This policy configures whether per-machine PowerToys installation is allowed or not.

If enabled, per-machine installation is not allowed.

If disabled or not configured, per-machine installation is allowed.
</string>
<string id="DisablePerUserInstallationDescription">This policy configures whether per-user PowerToys installation is allowed or not.

Expand Down Expand Up @@ -99,7 +93,6 @@ If this setting is disabled, experimentation is not allowed.
<string id="ConfigureEnabledUtilityShortcutGuide">Shortcut Guide: Configure enabled state</string>
<string id="ConfigureEnabledUtilityTextExtractor">Text Extractor: Configure enabled state</string>
<string id="ConfigureEnabledUtilityVideoConferenceMute">Video Conference Mute: Configure enabled state</string>
<string id="DisablePerMachineInstallation">Disable per-machine installation</string>
<string id="DisablePerUserInstallation">Disable per-user installation</string>
<string id="DisableAutomaticUpdateDownload">Disable automatic downloads</string>
<string id="SuspendNewUpdateToast">Suspend Action Center notification for new updates</string>
Expand Down

0 comments on commit 5c6392c

Please sign in to comment.