如何使用命令参数从<自定义操作 /> 调用.exe文件

how call .exe file from <custom action /> with command arguments

本文关键字:gt 调用 exe 文件 操作 自定义 参数 何使用 lt 命令      更新时间:2023-10-16

我创建自定义动作:

<CustomAction Id="LaunchApplication" FileKey="FileKeyExe" ExeCommand="" Return="asyncNoWait"/>

和安装后执行文件:

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

一切正常!

,但我需要运行我的。exe文件与命令参数。我该怎么做呢?

要发送exe命令行参数,您需要将它们包含在execcommand字段中,例如

 <CustomAction Id="ExecutingAwesomeness" ExeCommand="Awesome.exe -fireworks -parade" />