如何关闭 Windows Installer 以阻止 MSI 包
有没有办法阻止用户安装.msi包? Windows Installer 是一项后台服务,用于管理基于 MSI 的程序的安装和卸载。要阻止 MSI 安装程序,您可以使用组策略或注册表调整来关闭 Windows Installer。
方法 1:使用 GPO 禁用 Windows Installer
- 打开本地组策略编辑器并展开
Computer Configuration -> Administrative Templates -> Windows Components -> Windows Installer。双击名为“关闭 Windows 安装程序”在右窗格中。
- 选择启用。单击“禁用 Windows 安装程序”下拉列表并选择总是。
- 点击好的并重新启动系统以应用更改。下次尝试运行任何 .msi 软件包时,您将收到错误消息“系统管理员已设置策略来阻止此安装。”
方法 2:使用注册表调整禁用 Windows Installer
- 打开注册表编辑器并浏览到:
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer。如果安装人员子项不存在,您必须先创建它。 - 双击 32 位 DWORD禁用MSI在右侧窗格中,将值设置为 2。
- 关闭注册表编辑器并重新启动 Windows 以使更改生效。如果需要再次启用Windows安装程序,只需设置值禁用MSI到 0 就完成了。
