我正在使用WiX为我们的产品开发安装程序。我的安装程序安装的服务之一需要重新启动。
在 UI 安装过程中,它会询问用户,如果用户说“否”,则不会重新启动。但是,使用静默安装,即使我指定了/norestart
选项,它仍然会重新启动机器。
以下是没有静默安装的情况的日志,如果用户选择“否”,它不会重新启动:
MSI (s) (F0:58) [04:42:00:795]: Windows Installer reconfigured the product. Product Name: MyProduct. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: MyOrg. Reconfiguration success or error status: 0.
MSI (s) (F0:58) [04:42:00:795]: Value of RebootAction property is
MSI (s) (F0:58) [04:42:00:795]: Windows Installer requires a system restart. Product Name: MyProduct. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: MyOrg. **Type of System Restart: 2. Reason for Restart: 1.**
MSI (s) (F0:58) [04:42:00:796]: Product: MyProduct. Restart required. The installation or update for the product required a restart for all changes to take effect. The restart was deferred to a later time.
以下是日志,即使/norestart
提供了该选项,也会发生重新启动:
MSI (s) (50:78) [04:37:06:985]: Windows Installer reconfigured the product. Product Name: MyProduct. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: MyOrg. Reconfiguration success or error status: 0.
MSI (s) (50:78) [04:37:06:985]: Value of RebootAction property is
MSI (s) (50:78) [04:37:06:985]: Windows Installer requires a system restart. Product Name: MyProduct. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: MyOrg. **Type of System Restart: 1. Reason for Restart: 1**.
比较两个日志文件,我注意到以下差异:
成功案例: 系统重启类型: 2. 重启原因: 1.
故障案例: 系统重启类型:1.重启原因:1
我是否需要在 WiX 代码中添加任何属性来处理这种情况?