2012-10-22 66 views
3

我有一個WiX Burn安裝包和一系列軟件包。WiX CAQuietExec CustomAction暫停安裝

更新以/ passive模式運行,無需用戶交互。

最後一個數據包僅在更新運行,唯一的目的是運行一個可執行文件,它使用下面的代碼..

<!-- Quiet Execution Deferred execution with qtExec--> 
<Property Id="QtExecDeferredExample" Value="&quot;C:\Program Files (x86)\Acme Inc\MyApp.exe&quot;"/> 
<CustomAction Id="QtExecDeferredExample" BinaryKey="WixCA" DllEntry="CAQuietExec" 
       Execute="deferred" Return="ignore" Impersonate="no"/> 

<InstallExecuteSequence> 
    <Custom Action="QtExecDeferredExample" Before="InstallFinalize"/> 
</InstallExecuteSequence> 

然而,儘管MyApp.exe的啓動,安裝將不會終止,直到MyApp.exe退出。很明顯,我想讓應用程序啓動,安裝程序終止其自我。

我不能修改CustomAction到後運行安裝完成..

<Custom Action="QtExecDeferredExample" After="InstallFinalize"/> 

因爲以下幾點:

ICE77: QtExecDeferredExample is a in-script custom action. 
It must be sequenced in between the InstallInitialize action and the InstallFinalize action in the InstallExecuteSequence table 

讚賞任何想法。

更新: BrianJ的回答讓我回答。作爲@escist已經打聽,我CA的相關部分如下:

<!-- CA To set the property of the process to start--> 
    <CustomAction 
       Id  ="SetProcessToStart" 
       BinaryKey ="WiXCustomActions" 
       DllEntry ="GetProcessToStart" 
       Execute ="immediate" /> 

    <!-- CA to start the process--> 
    <CustomAction 
       Id   ="StartApp" 
       Directory ="APPLICATIONROOTDIRECTORY" 
       ExeCommand ="[PROCESSTOSTART]" 
       Execute ="deferred" 
       Return  ="asyncNoWait"/> 

    </Fragment> 
</Wix> 

和其他地方(有一些我的應用程序,可能已經開始這個過程,所以該路徑被存儲在註冊表中)..

<Property Id="PROCESSTOSTART">[Not Set]</Property> 
<InstallExecuteSequence> 
    <!-- Use our Custom Action to set the PROCESSTOSTART property--> 
    <!-- Custom Action to get the value from registry of the App that started the bootstrapper--> 
    <Custom Action="SetProcessToStart" Before="LaunchConditions">NOT Installed</Custom> 

    <!-- NOT installed ensures that the CA does not get fired on an uninstall --> 
    <Custom Action="StartApp" Before="InstallFinalize">NOT Installed</Custom> 
</InstallExecuteSequence> 
+0

你能找到解決這個問題的辦法嗎? – escist

回答

1

將自定義操作中「返回」的值更改爲Return="asyncNoWait"

+0

如果沒有屬性ExeCommand存在,就會導致像'CustomAction/@ Return屬性的值'asyncNoWait'這樣的編譯錯誤。 ' – escist

+0

有點晚,以此作爲答案,所以道歉。 @escist - 將使用我的工作自定義操作更新我的原始問題。 –