【问题标题】:Set timeout for shutting down a service in WiX在 WiX 中设置关闭服务的超时时间
【发布时间】:2013-04-05 13:07:17
【问题描述】:

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

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

【问题讨论】:

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


    【解决方案1】:

    不幸的是,等待在 Windows Installer 中是不可配置的。来自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(就像每个自定义操作一样),所以我会尽可能努力修复服务。

    【讨论】:

    • 是的,我担心我不得不这样做。我希望有一个快速的“只是将此超时设置得更高一点”的解决方案,但真正正确的做法是解决任何阻止服务及时关闭的问题
    • @RobMensching - MSI SDK Doco 过度简化了这种关系。有一个注册表值 (ServicesPipeTimeOut),当设置时,它会将 30 秒增加到您想要的任何毫秒。我个人是为了让服务停止和启动更快,而不是在安装中使用系统设置,但我已经看到 Microsoft 产品(例如 TFS 将其设置为 60 秒)对其进行了修改。
    • 我最终优化了关闭服务器的方式,因此现在只需几秒钟而不是一分钟。地狱优化AMIRITE?哈哈
    猜你喜欢
    • 1970-01-01
    • 2012-11-04
    • 2011-06-04
    • 2013-05-18
    • 2019-03-27
    • 2017-10-21
    • 1970-01-01
    • 2015-08-07
    • 2012-09-24
    相关资源
    最近更新 更多