2012-04-26 43 views
1

安裝應該要求關閉所有瀏覽器:iexplore.exe,chrome.exe和firefox.exe,但應提示用戶這樣做。我無法獲得FileInUse對話框。以下是相關部分 - 我錯過了什麼?使用CloseMessage =「yes」,它們都會關閉,但我希望FilesInUse能夠取而代之。Wix:如何使用FileInUse對話框

<UI> 
    <UIRef Id="WixUI_InstallDir" /> 
    <UIRef Id="WixUI_ErrorProgressText" /> 
    <DialogRef Id="FilesInUse" /> 
    <DialogRef Id="MsiRMFilesInUse" /> 
</UI> 

<InstallUISequence> 
    <Custom Action="WixCloseApplications" Before="AppSearch" /> 
</InstallUISequence> 

<InstallExecuteSequence> 
    <Custom Action="WixCloseApplications" Before="InstallValidate" /> 
</InstallExecuteSequence> 

<util:CloseApplication Id="CloseIE" CloseMessage="no" 
         Description="Internet Explorer is still running." 
         ElevatedCloseMessage="no" 
         RebootPrompt="no" 
         Property="IERunning" 
         Target="iexplore.exe"/> 
<util:CloseApplication Id="CloseChrome" CloseMessage="no" 
         Description="Chrome is still running." 
         ElevatedCloseMessage="no" 
         RebootPrompt="no" 
         Property="ChromeRunning" 
         Target="chrome.exe"/> 
<util:CloseApplication Id="CloseFirefox" CloseMessage="no" 
         Description="Firefox is still running." 
         ElevatedCloseMessage="no" 
         RebootPrompt="no" 
         Property="FirefoxRunning" 
         Target="firefox.exe"/> 

更新 從日誌中,有些事情似乎是發生,但沒有關閉,沒有任何提示。下面的日誌會發生兩次(如我所料),一次在AppSearch之前,一次在InstallValidate之前,但永遠不會調用FileInUse對話框。我嘗試將WixUI_InstallDir更改爲Mondo,但這沒有幫助。

Action 22:28:12: WixCloseApplications. 
Action start 22:28:12: WixCloseApplications. 
WixCloseApplications: Entering WixCloseApplications in C:\Users\tim\AppData\Local\Temp\MSIC78D.tmp, version 3.6.2809.0 
WixCloseApplications: Checking App: iexplore.exe 
WixCloseApplications: App: iexplore.exe found running, 2 processes, setting 'IERunning' property. 
WixCloseApplications: Checking App: chrome.exe 
WixCloseApplications: App: chrome.exe found running, 7 processes, setting 'ChromeRunning' property. 
WixCloseApplications: Checking App: firefox.exe 
Action ended 22:28:13: WixCloseApplications. Return value 1. 
+0

WixCloseApplications的其他選項包括運行它Before = LaunchConditions,然後設置一個不是RunningIE的Condition(例如)。如果您沒有設置WixCloseApplications自定義操作,它將在InstallFiles之前發生。但仍然沒有觸發FilesInUse。幫幫我! – tofutim 2012-04-26 07:33:53

回答

3

現在有一段同樣的問題搞亂後,我想我可以說,你不能解決這種方式

看,問題是隻有Win7和Vista有Restart Manager,允許你檢測正在運行的程序,而只有那些使用你的文件的。這就是FilesInUse對話框的用途。您現在可能已經意識到,如果沒有安裝這些文件,那麼這些文件就無法使用,所以它就是:您無法按照您嘗試的方式解決它。事實上,你的在WinXP中甚至都沒有重啓管理器。

我找到其它解決方法是:

  • 繼續您啓動的方式,而是讓自己的對話框有很多自定義操作的
  • 您的自定義操作DLL在C/C++,可以檢查運行進程並通知MSI顯示FilesInUse對話框。 (你必須找出如何使您的自定義操作DLL,但我會建議去爲這個解決方案)

希望這有助於你,如果你還沒有解決它了。

0

舊問題的新答案。願它幫助某人。這裏是:

在這種情況下,這些ClosePromtCA應該很好地工作。它只是強制用戶關閉指定的進程 - 在上面的情況chrome.exe,firefox.exe ...此外,自定義操作是開源的,所以它應該很容易適應您的需求。