在静默模式下使用命令行参数执行批处理文件

时间:2012-09-15 10:36:53

标签: wix custom-action

我想执行我的批处理文件,它需要3 cmd行参数,它应该执行静默模式[不应该看到控制台] .Below是我的wix代码:

    <CustomAction Id="ScrptsMngr" Property= "PrptyScrptsMngr"
              Value="&quot;[#filC22B3172A663C01F17B8CE4D55CB7DE2]&quot; [ARG1] [ARG2] [ARG3]" Execute="immediate"/>
               <CustomAction Id="PrptyScrptsMngr" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="asyncWait" Impersonate="yes"/>

上述习惯行为对我不起作用。当CAQuietExec执行失败时,它总是抛出错误。我的自定义操作是否正确

1 个答案:

答案 0 :(得分:-1)

尝试为每个ARG1 / 2/3添加“(”)并尝试。还要确保在product.wxs seqeunce中的'ScrptsMngr'之后设置'PrptyScrptsMngr'调用

<CustomAction Id="QtCmdLineRmDummies" Property="QtExecCmdLine"Value="&quot;[SystemFolder]cmd.exe&quot; /c del /Q &quot;[INSTALLLOCATION]\dummy*.*&quot;" />
<CustomAction Id="QtCmdRmDummies" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="ignore" />

在product.wxs

<Custom Action="QtCmdLineRmDummies" After="InstallFinalize">NOT INSTALLED AND NOT REMOVE</Custom>
<Custom Action="QtCmdRmDummies" After="QtCmdLineRmDummies">NOT INSTALLED AND NOT REMOVE</Custom>