Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
AmelBawa-msft committed Oct 31, 2024
1 parent d84cf21 commit ca649fe
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions doc/admx/DesktopAppInstaller.admx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<text id="WindowsPackageManagerDefaultProxy" valueName="DefaultProxy" />
</elements>
</policy>
<policy name="EnableSmartScreenValidation" class="Machine" displayName="$(string.EnableSmartScreenValidation)" explainText="$(string.EnableSmartScreenValidationExplanation)" key="Software\Policies\Microsoft\Windows\AppInstaller" valueName="EnableSmartScreenValidation">
<policy name="EnableWindowsPackageManagerSmartScreenCheck" class="Machine" displayName="$(string.EnableWindowsPackageManagerSmartScreenCheck)" explainText="$(string.EnableWindowsPackageManagerSmartScreenCheckExplanation)" key="Software\Policies\Microsoft\Windows\AppInstaller" valueName="EnableWindowsPackageManagerSmartScreenCheck">
<parentCategory ref="AppInstaller" />
<supportedOn ref="windows:SUPPORTED_Windows_10_0_RS5" />
<enabledValue>
Expand All @@ -193,7 +193,7 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="EnableAllowedSecurityZones" class="Machine" displayName="$(string.EnableAllowedSecurityZones)" explainText="$(string.EnableAllowedSecurityZonesExplanation)" presentation="$(presentation.AllowedSecurityZones)" key="Software\Policies\Microsoft\Windows\AppInstaller" valueName="EnableAllowedSecurityZones">
<policy name="EnableWindowsPackageManagerAllowedSecurityZones" class="Machine" displayName="$(string.EnableWindowsPackageManagerAllowedSecurityZones)" explainText="$(string.EnableWindowsPackageManagerAllowedSecurityZonesExplanation)" presentation="$(presentation.WindowsPackageManagerAllowedSecurityZones)" key="Software\Policies\Microsoft\Windows\AppInstaller" valueName="EnableWindowsPackageManagerAllowedSecurityZones">
<parentCategory ref="AppInstaller" />
<supportedOn ref="windows:SUPPORTED_Windows_10_0_RS5" />
<enabledValue>
Expand All @@ -203,7 +203,7 @@
<decimal value="0" />
</disabledValue>
<elements>
<enum id="LocalMachine" key="Software\Policies\Microsoft\Windows\AppInstaller\AllowedSecurityZones" valueName="LocalMachine" required="false">
<enum id="LocalMachine" key="Software\Policies\Microsoft\Windows\AppInstaller\WindowsPackageManagerAllowedSecurityZones" valueName="LocalMachine" required="false">
<item displayName="$(string.SecurityZoneBlocked)">
<value>
<decimal value="0" />
Expand All @@ -215,7 +215,7 @@
</value>
</item>
</enum>
<enum id="Intranet" key="Software\Policies\Microsoft\Windows\AppInstaller\AllowedSecurityZones" valueName="Intranet">
<enum id="Intranet" key="Software\Policies\Microsoft\Windows\AppInstaller\WindowsPackageManagerAllowedSecurityZones" valueName="Intranet">
<item displayName="$(string.SecurityZoneBlocked)">
<value>
<decimal value="0" />
Expand All @@ -227,7 +227,7 @@
</value>
</item>
</enum>
<enum id="TrustedSites" key="Software\Policies\Microsoft\Windows\AppInstaller\AllowedSecurityZones" valueName="TrustedSites">
<enum id="TrustedSites" key="Software\Policies\Microsoft\Windows\AppInstaller\WindowsPackageManagerAllowedSecurityZones" valueName="TrustedSites">
<item displayName="$(string.SecurityZoneBlocked)">
<value>
<decimal value="0" />
Expand All @@ -239,7 +239,7 @@
</value>
</item>
</enum>
<enum id="Internet" key="Software\Policies\Microsoft\Windows\AppInstaller\AllowedSecurityZones" valueName="Internet">
<enum id="Internet" key="Software\Policies\Microsoft\Windows\AppInstaller\WindowsPackageManagerAllowedSecurityZones" valueName="Internet">
<item displayName="$(string.SecurityZoneBlocked)">
<value>
<decimal value="0" />
Expand All @@ -251,7 +251,7 @@
</value>
</item>
</enum>
<enum id="UntrustedSites" key="Software\Policies\Microsoft\Windows\AppInstaller\AllowedSecurityZones" valueName="UntrustedSites">
<enum id="UntrustedSites" key="Software\Policies\Microsoft\Windows\AppInstaller\WindowsPackageManagerAllowedSecurityZones" valueName="UntrustedSites">
<item displayName="$(string.SecurityZoneBlocked)">
<value>
<decimal value="0" />
Expand Down
14 changes: 7 additions & 7 deletions doc/admx/en-US/DesktopAppInstaller.adml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,10 @@ If you disable this setting, users will not be able to use the Windows Package M
If you disable or do not configure this setting, no proxy will be used by default.

If you enable this setting, the specified proxy will be used by default.</string>
<string id="EnableAllowedSecurityZones">Enable App Installer Allowed Security Zones</string>
<string id="EnableAllowedSecurityZonesExplanation"></string>
<string id="EnableSmartScreenValidation">Enable App Installer Smart Screen Validation</string>
<string id="EnableSmartScreenValidationExplanation"></string>
<string id="SecurityZoneAllowed">Allow</string>
<string id="SecurityZoneBlocked">Block</string>
<string id="EnableWindowsPackageManagerAllowedSecurityZones">Enable App Installer Allowed Zones for the Windows Package Manager</string>
<string id="EnableWindowsPackageManagerAllowedSecurityZonesExplanation"></string>
<string id="EnableWindowsPackageManagerSmartScreenCheck">Enable Microsoft SmartScreen checks for the Windows Package Manager</string>
<string id="EnableWindowsPackageManagerSmartScreenCheckExplanation"></string>
<string id="EnableMsixAllowedZones">Enable App Installer Allowed Zones for MSIX Packages</string>
<string id="EnableMsixAllowedZonesExplanation">This policy controls whether App Installer allows installing packages originating from specific URL Zones. A package's origin is determined by its URI and whether a Mart-of-the-Web (MotW) is present. If multiple URIs are involved, all of them are considered; for example, when using a .appinstaller file that involves redirection.

Expand All @@ -140,6 +138,8 @@ If you disable or do not configure this policy, users will be able to install MS
If you enable or do not configure this policy, the package URI will be evaluated with Microsoft SmartScreen before installation. This check is only done for packages that come from the internet.

If you disable, Microsoft SmartScreen will not be consulted before installing a package.</string>
<string id="SecurityZoneAllowed">Allow</string>
<string id="SecurityZoneBlocked">Block</string>
</stringTable>
<presentationTable>
<presentation id="SourceAutoUpdateInterval">
Expand All @@ -156,7 +156,7 @@ If you disable, Microsoft SmartScreen will not be consulted before installing a
<label>Default Proxy</label>
</textBox>
</presentation>
<presentation id="AllowedSecurityZones">
<presentation id="WindowsPackageManagerAllowedSecurityZones">
<dropdownList refId="LocalMachine" noSort="true" defaultItem="1">Local Machine</dropdownList>
<dropdownList refId="Intranet" noSort="true" defaultItem="1">Intranet</dropdownList>
<dropdownList refId="TrustedSites" noSort="true" defaultItem="1">Trusted Sites</dropdownList>
Expand Down
8 changes: 4 additions & 4 deletions src/AppInstallerCLICore/Workflows/UriValidationFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace AppInstaller::CLI::Workflow
// Check if smart screen is required for a given zone.
bool IsSmartScreenRequired(Settings::SecurityZoneOptions zone)
{
auto isSmartScreenEnabled = Settings::GroupPolicies().IsEnabled(Settings::TogglePolicy::Policy::SmartScreenValidation);
auto isSmartScreenEnabled = Settings::GroupPolicies().IsEnabled(Settings::TogglePolicy::Policy::SmartScreenCheck);
AICLI_LOG(Core, Info, << "SmartScreen validation is " << (isSmartScreenEnabled ? "enabled" : "disabled"));

auto isSecurityZoneCheckRequired = zone == Settings::SecurityZoneOptions::Internet || zone == Settings::SecurityZoneOptions::UntrustedSites;
Expand Down Expand Up @@ -83,20 +83,20 @@ namespace AppInstaller::CLI::Workflow
{
if (!Settings::GroupPolicies().IsEnabled(Settings::TogglePolicy::Policy::AllowedSecurityZones))
{
AICLI_LOG(Core, Info, << "AllowedSecurityZones policy is disabled");
AICLI_LOG(Core, Info, << "WindowsPackageManagerAllowedSecurityZones policy is disabled");
return false;
}

auto allowedSecurityZones = Settings::GroupPolicies().GetValue<Settings::ValuePolicy::AllowedSecurityZones>();
if (!allowedSecurityZones.has_value())
{
AICLI_LOG(Core, Warning, << "AllowedSecurityZones policy is not set");
AICLI_LOG(Core, Warning, << "WindowsPackageManagerAllowedSecurityZones policy is not set");
return false;
}

if (allowedSecurityZones->find(zone) == allowedSecurityZones->end())
{
AICLI_LOG(Core, Warning, << "Security zone " << zone << " was not found in the group policy AllowedSecurityZones");
AICLI_LOG(Core, Warning, << "Security zone " << zone << " was not found in the group policy WindowsPackageManagerAllowedSecurityZones");
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/AppInstallerCLITests/TestSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace TestCommon
const std::wstring EnableWindowsPackageManagerCommandLineInterfaces = L"EnableWindowsPackageManagerCommandLineInterfaces";
const std::wstring ConfigurationPolicyValueName = L"EnableWindowsPackageManagerConfiguration";
const std::wstring ProxyCommandLineOptionsPolicyValueName = L"EnableWindowsPackageManagerProxyCommandLineOptions";
const std::wstring AllowedSecurityZonesPolicyValueName = L"EnableAllowedSecurityZones";
const std::wstring SmartScreenValidationPolicyValueName = L"EnableSmartScreenValidation";
const std::wstring AllowedSecurityZonesPolicyValueName = L"EnableWindowsPackageManagerAllowedSecurityZones";
const std::wstring SmartScreenValidationPolicyValueName = L"EnableWindowsPackageManagerSmartScreenCheck";

const std::wstring SourceUpdateIntervalPolicyValueName = L"SourceAutoUpdateInterval";
const std::wstring SourceUpdateIntervalPolicyOldValueName = L"SourceAutoUpdateIntervalInMinutes";
Expand Down
8 changes: 4 additions & 4 deletions src/AppInstallerSharedLib/GroupPolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ namespace AppInstaller::Settings
CONFIGURATION_ALLOWED_ZONES_READ(UntrustedSites);
#undef CONFIGURATION_ALLOWED_ZONES_READ

AICLI_LOG(Core, Warning, << "Unknown value in AllowedSecurityZones: " << entry.Name());
AICLI_LOG(Core, Warning, << "Unknown value in WindowsPackageManagerAllowedSecurityZones: " << entry.Name());
return std::nullopt;
}
}
Expand Down Expand Up @@ -393,9 +393,9 @@ namespace AppInstaller::Settings
case TogglePolicy::Policy::ProxyCommandLineOptions:
return TogglePolicy(policy, "EnableWindowsPackageManagerProxyCommandLineOptions"sv, String::PolicyEnableProxyCommandLineOptions);
case TogglePolicy::Policy::AllowedSecurityZones:
return TogglePolicy(policy, "EnableAllowedSecurityZones"sv, String::PolicyEnableAllowedSecurityZones);
case TogglePolicy::Policy::SmartScreenValidation:
return TogglePolicy(policy, "EnableSmartScreenValidation"sv, String::PolicyEnableSmartScreenValidation);
return TogglePolicy(policy, "EnableWindowsPackageManagerAllowedSecurityZones"sv, String::PolicyEnableAllowedSecurityZones);
case TogglePolicy::Policy::SmartScreenCheck:
return TogglePolicy(policy, "EnableWindowsPackageManagerSmartScreenCheck"sv, String::PolicyEnableSmartScreenValidation);
default:
THROW_HR(E_UNEXPECTED);
}
Expand Down
4 changes: 2 additions & 2 deletions src/AppInstallerSharedLib/Public/winget/GroupPolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace AppInstaller::Settings
Configuration,
ProxyCommandLineOptions,
AllowedSecurityZones,
SmartScreenValidation,
SmartScreenCheck,
Max,
};

Expand Down Expand Up @@ -181,7 +181,7 @@ namespace AppInstaller::Settings
POLICY_MAPPING_LIST_SPECIALIZATION(ValuePolicy::AdditionalSources, SourceFromPolicy, "AdditionalSources"sv);
POLICY_MAPPING_LIST_SPECIALIZATION(ValuePolicy::AllowedSources, SourceFromPolicy, "AllowedSources"sv);

POLICY_MAPPING_ENUM_SPECIALIZATION(ValuePolicy::AllowedSecurityZones, SecurityZoneMap_t, SecurityZoneOptions, bool, "AllowedSecurityZones"sv);
POLICY_MAPPING_ENUM_SPECIALIZATION(ValuePolicy::AllowedSecurityZones, SecurityZoneMap_t, SecurityZoneOptions, bool, "WindowsPackageManagerAllowedSecurityZones"sv);
}

// Representation of the policies read from the registry.
Expand Down

0 comments on commit ca649fe

Please sign in to comment.