使用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" />这很好用,但是由于某种原因,CMD窗口仍然是打开的,当应用程序关闭时,它也会关闭。
我在谷歌找不到类似的东西,有人遇到过类似的问题吗?
谢谢
编辑:
我正在尝试,就像@Rolo建议的那样,QtExecCmdLine:
<Property Id="QtExecCmdLine" Value='C:\Users\User\Desktop\tests.exe'/>
<CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>还包括:
<Publish Event='DoAction' Value='QtExecExample'>(NOT Installed) AND (LAUNCHPRODUCT = 1)
</Publish>但什么都没发生,日志上写着:
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.填补丢失在这里
发布于 2014-11-24 07:26:07
谢谢你的帮助,我终于解决了:
<Property Id="WixShellExecTarget" Value='[TARGETDIR]ManagerAndControl.exe' />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<!-- UI code here -->
<Publish Event='DoAction' Value='LaunchApplication'>(NOT Installed) AND (LAUNCHPRODUCT = 1)</Publish>发布于 2014-11-20 16:01:35
使用“安静的执行自定义操作”代替。
http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html
更新:
我得更新我的答案。您应该使用WixShellExec自定义操作。它的工作原理非常类似于安静执行CA,但它将允许您启动应用程序,而不等待它关闭。
但是,它只能用作即时的自定义操作。
这里有一个您需要的实现的完整示例:
install.html
http://wixtoolset.org/documentation/manual/v3/customactions/shellexec.html
https://stackoverflow.com/questions/27043190
复制相似问题