Ehu*_*and 0 cmd custom-action wix
使用Wix安装程序(win 8),我有一个自定义操作,使用Wix成功安装后运行应用程序:
<CustomAction Id='LaunchFile'
Directory='TARGETDIR'
Impersonate="no"
Execute="immediate"
ExeCommand='[SystemFolder]cmd.exe start CMD /c ""[TARGETDIR]ManagerAndControl.exe""'
Return="asyncNoWait" />
Run Code Online (Sandbox Code Playgroud)
这很好用,但由于某种原因,CMD窗口保持打开状态,当应用程序关闭时它也会关闭.
我在谷歌找不到类似的东西,有人遇到过类似的问题吗?
谢谢
编辑:
正如@Rolo建议的那样,我正在尝试QtExecCmdLine:
<Property Id="QtExecCmdLine" Value='C:\Users\User\Desktop\tests.exe'/>
<CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
Run Code Online (Sandbox Code Playgroud)
并且:
<Publish Event='DoAction' Value='QtExecExample'>(NOT Installed) AND (LAUNCHPRODUCT = 1)
</Publish>
Run Code Online (Sandbox Code Playgroud)
但没有任何反应,日志说:
Action start 11:02:49: QtExecExample.
MSI (c) (E0:20) [11:02:49:911]: Invoking remote custom action. DLL: C:\Users\User\AppData\Local\Temp\MSIAD42.tmp, Entrypoint: CAQuietExec
MSI (c) (E0:EC) [11:02:49:913]: Cloaking enabled.
MSI (c) (E0:EC) [11:02:49:913]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (E0:EC) [11:02:49:913]: Connected to service for CA interface.
MSI (c) (E0!00) [11:02:49:944]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is 'C:\Users\User\Desktop\tests.exe'.
Action ended 11:02:49: QtExecExample. Return value 3.
DEBUG: Error 2896: Executing action QtExecExample failed.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2896. The arguments are: QtExecExample, ,
Action ended 11:02:49: FinishedForm. Return value 3.
Action ended 11:02:49: INSTALL. Return value 1.
Run Code Online (Sandbox Code Playgroud)
填补在这里失去了
请改用"安静执行自定义操作".
http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html
更新:
我必须更新我的答案.您应该使用WixShellExec自定义操作.它与Quiet Execution CA非常相似,但它允许您启动应用程序而无需等待它关闭.
但是,它只能用作立即自定义操作.
这里有一个完整的实现示例:
http://wixtoolset.org/documentation/manual/v3/customactions/shellexec.html
| 归档时间: |
|
| 查看次数: |
1190 次 |
| 最近记录: |