WiX Burn: LaunchTarget fails with error 0x80070002

二次信任 提交于 2019-12-08 06:15:25

问题


Setting LaunchTarget e.g. to "cmd.exe" works fine, after the installation of the burn package, the desired command line window pops up. However, setting LaunchTarget to for example "[InstallFolder]\Path\To\Postinstallexecutable.exe" yields an error:

Error 0x80070002: Failed to launch target: C:\Program Files (x86)\Path\To\Postinstallexecutable.exe

The path is correct, executing "C:\Program Files (x86)\Path\To\Postinstallexecutable.exe" at the command line works fine. Is this a bug or am I missing something? WiX toolset version is 3.8.309.0.

Update: After a little more testing, the problem seems to occur only when you try to pass a parameter to the command in LaunchTarget. So for example using

<Variable Name="LaunchTarget" Value="[InstallFolder]\Basiskomponenten\Allgemein\test.cmd" />

works, while

<Variable Name="LaunchTarget" Value="[InstallFolder]\Basiskomponenten\Allgemein\test.cmd Test123" />

results in an 0x80070002 error.


回答1:


The LaunchTarget variable points only to the executable that should be launched, it cannot be provided the command-line arguments. It wasn't until a very recent build of WiX v3.8 that you could set a second variable called LaunchArguments that provides the arguments. So, try upgrading to yesterday's WiX v3.8 build (or newer) and do:

<Variable Name="LaunchTarget" Value="[InstallFolder]\Basiskomponenten\Allgemein\test.cmd" />
<Variable Name="LaunchArguments" Value="Test123" />


来源:https://stackoverflow.com/questions/16031778/wix-burn-launchtarget-fails-with-error-0x80070002

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!