设置关闭WiX中的服务的超时

时间:2013-04-05 13:07:17

标签: .net wix windows-installer wix3.5

我的服务需要30-60秒才能停止。当我运行安装程序并将服务升级到新版本时,我总是得到以下窗口(我在继续安装之前验证服务已停止。

Screenshot of error: The setup was unable to automatically close all requested applications. Please ensure that the applications holding file in use are closed before continuing with the installation.

有没有办法在安装程序中设置此超时,以便应用程序有足够的时间停止服务以获取最终用户可能安装的任何更新?我们的安装程序使用WiX 3.5构建。

1 个答案:

答案 0 :(得分:3)

不幸的是,Windows安装程序中无法配置等待。来自their documentation

Wait 

Leaving this field null or entering a value of 1 causes the installer to 
wait a maximum of 30 seconds for the service to complete before proceeding.

The wait can be used to allow additional time for a critical event to return
a failure error. A value of 0 in this field means to wait only until the
service control manager (SCM) reports that this service is in a pending state
before continuing with the installation.

您需要让服务更快地关闭(对最终用户来说也很好;)或者必须自己编写一个自定义操作来执行关机。这将是一大堆工作并添加更多fragility to the install(因为每个自定义操作都会这样做)所以我会尽可能努力地修复服务。