2013-04-05 82 views
0

我有一項服務需要30-60秒之間的時間才能停止。當我運行安裝程序,提升服務的新版本,我總是得到下面的窗口(我驗證服務之前,繼續安裝停止。設置關閉WiX服務的超時時間

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構建的

回答

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(因爲每個自定義動作都會),所以我會盡可能地努力修復該服務。

+0

是的,我害怕我必須這樣做。我希望能夠快速「將此超時設置得更高」解決方案,但要做的正確的事情就是解決無法及時關閉服務的任何問題 – 2013-04-05 13:40:57

+1

@RobMensching - MSI SDK Doco過分簡化了這種關係。有一個註冊表值(ServicesPipeTimeOut),它在設置時將30秒增加到所需的毫秒數。我個人是爲了讓服務停止並且更快啓動,而不是在安裝時插入系統設置,但我看到微軟產品(例如TFS將其設置爲60秒)修改它。 – 2013-04-05 14:42:22

+1

我最終優化了我們如何關閉服務器,所以現在只需要幾秒鐘而不是一分鐘。優化AMIRITE的地獄?哈哈 – 2013-04-12 12:47:13