2017-03-03 30 views
0

我想安裝後執行一個exe文件。以下是我如何努力做到這一點。如何向Wix中的自定義動作exe添加參數?

<Property Id="WixShellExecTarget" Value="[#fil7D28AEF774656849395A2FA20A5C963D]" /> 
    <CustomAction Id="LaunchMosquitto" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" /> 

    <InstallExecuteSequence> 
     <Custom Action="LaunchMosquitto" After="InstallFinalize" /> 
    </InstallExecuteSequence> 

在這裏,[#fil7D28AEF774656849395A2FA20A5C963D]指文件ID。我需要使用參數「-c config.conf」運行這個exe文件。我怎樣才能做到這一點?任何幫助將非常感激。我不需要啓動命令提示符就會發生這種情況。答案後

日誌:

MSI (s) (D0:24) [18:32:16:273]: Executing op: ActionStart(Name=LaunchMosquitto,,) 
MSI (s) (D0:24) [18:32:16:273]: Executing op: CustomActionSchedule(Action=LaunchMosquitto,ActionType=3137,Source=BinaryData,Ta rget=WixQuietExec64,CustomActionData="C:\Kube2.0\Mosquitto\mosquitto.exe" -c C:\Kube2.0\Mosquitto\mosquitto.conf) 
+0

本手冊中的這篇文章應回答您的問題:http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html。特別是,「延期執行」部分 –

回答

0

燕建議你應該使用一個安靜的CA.

<SetProperty Id="LaunchMosquitto" Value="&quot;[#fil7D28AEF774656849395A2FA20A5C963D]&quot; -c config.conf" Before="LaunchMosquitto" Sequence="execute"/> 
<CustomAction Id="LaunchMosquitto" 
       BinaryKey="WixCA" 
       DllEntry="WixQuietExec64" 
       Execute="deferred" 
       Return="check" 
       Impersonate="no"/> 

<InstallExecuteSequence> 
    <Custom Action="LaunchMosquitto" Before="InstallFinalize" /> 
</InstallExecuteSequence> 
+0

嘿,它成功運行命令,並且進程已經開始。但安裝不會完成!我想那是因爲產生的過程?有任何想法嗎? – mayooran

+0

改變Return =「忽略」 –

+0

是的隊友,也試過了。仍然同樣的問題依然存在。 – mayooran