组策略和 MSIX 打包的应用Group Policy and MSIX packaged apps

使用 MSIX 的开发人员可以采用类似于其他安装程序类型的方式利用组策略。Developers who use MSIX can leverage Group Policy in a similar way to other installer types.

如果你已将 Win32 应用打包成 MSIX(或者使用桌面桥生成了应用),则该应用已启用完全信任功能。If you have packaged your Win32 app into an MSIX (or if you built your app using the Desktop Bridge), your app has the full trust capability enabled. 这样,便可从组策略注册表项中读取数据。This allows you to read from the Group Policy registry keys. 在运行时,你的应用的组策略注册表视图与使用其他方法安装该应用后的相同。At run time, your app will have the same view of the Group Policy registry as it would if it had been installed using a different method. 从 Windows 10 版本 1809 开始,如果你的应用是通用 Windows 平台 (UWP) 应用,则该应用可访问这些组策略注册表项。Starting in Windows 10, version 1809, if your app is a Universal Windows Platform (UWP) app it can access the same Group Policy keys. 有关创建组策略的详细信息,请参阅此文For more information about creating Group Policy, see this article.

如果你正在使用 MSIX 打包工具将现有的安装程序转换为 MSIX,则无需执行新的操作,你的应用即可支持组策略。If you are converting an existing installer to MSIX by using the MSIX Packaging Tool, there is no new work needed for your app to support Group Policy. 可以像平时使用原始安装程序后那样管理组策略。Continue to manage Group Policies as you normally would for the original installer. 转换为 MSIX 的应用仍可从现有的组策略注册表项中读取数据。Apps converted to MSIX will still be able to read from existing Group Policy registry keys.

组策略原生并不支持安装 MSIX 应用程序。Group Policy does not have native support to install MSIX applications.

阻止 Microsoft Store 和 MSIX 的策略Policies for blocking Microsoft Store and MSIX

对于要如何配置来自 Microsoft Store 应用的应用更新,你可能有自己的要求。You may have your own requirements on how you want to configure app updates from the Microsoft Store app. Microsoft Store 应用会触发第三方应用和第一方应用(如“计算器”和“照片”)等应用的更新。The Store app triggers updates for apps, including third-party apps as well as first-party apps such as Calculator and Photos. 如果从计算机上删除了 Microsoft Store 应用,则可能导致该计算机上没有应用更新。If the Store app is removed from a computer, that can lead to no app updates on that computer.

下面列出了 Microsoft Store 策略,还显示了各个策略如何影响你的 MSIX 包。Here is the list of Store policies and how it impacts your MSIX packages.

关闭更新的自动下载和安装Turn off Automatic Download and Install of updates

此策略用于启用或禁用应用更新的自动下载和安装。This policy enables or disables the automatic download and installation of app updates. 如果启用此设置,则会关闭应用更新的自动下载和安装。If you enable this setting, the automatic download and installation of app updates is turned off. 如果禁用此设置,则会打开应用更新的自动下载和安装。If you disable this setting, the automatic download and installation of app updates is turned on. 如果不配置此设置,则应用更新的自动下载和安装由一项注册表设置确定,用户可通过 Microsoft Store 中的“设置”来更改它。If you don't configure this setting, the automatic download and installation of app updates is determined by a registry setting that the user can change using Settings in the Store.

  • GPO: Computer Configuration\Administrative Templates\Windows Components\StoreGPO: Computer Configuration\Administrative Templates\Windows Components\Store
  • 注册表: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore AutoDownload REG_DWORD数据:2 表示“启用”,指不更新应用,4 表示“禁用”,指自动更新应用)Registry: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore AutoDownload REG_DWORD (Data: enable = 2 = apps will not be updated, disable = 4 = app will be automatically updated)
  • 应用更新: 如果启用,则将关闭应用更新的自动下载和安装。App updates: If enabled, the automatic download and install of app updates will be turned off. 如果禁用,则将打开应用更新的自动下载和安装。If disabled, the automatic download and install of app updates will be turned on.

关闭 Microsoft Store 应用程序Turn off Store application

此策略用于拒绝或允许访问 Microsoft Store 应用程序。This policy denies or allows access to the Store application. 如果启用此设置,则拒绝访问 Microsoft Store 应用程序。If you enable this setting, access to the Store application is denied. 要安装应用更新,需具备对 Microsoft Store 的访问权限。Access to the Store is required for installing app updates. 如果禁用或不配置此设置,则允许访问 Microsoft Store 应用程序。If you disable or don't configure this setting, access to the Store application is allowed.

  • GPO: Computer Configuration\Administrative Templates\Windows Components\StoreUser Configuration\Administrative Templates\Windows Components\StoreGPO: Computer Configuration\Administrative Templates\Windows Components\Store or User Configuration\Administrative Templates\Windows Components\Store
  • 注册表: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStoreRemoveWindowsStore REG_DWORDHKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsStoreRemoveWindowsStore REG_DWORDRegistry: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStoreRemoveWindowsStore REG_DWORD or HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsStoreRemoveWindowsStore REG_DWORD
  • 应用更新: 如果是在计算机上下文中配置的,则此策略会关闭应用更新。App updates: If configured in the computer context, this policy turns off app updates.