WiX - CustomAction ExeCommand - 隐藏控制台 [英] WiX - CustomAction ExeCommand - Hide Console

查看:28
本文介绍了WiX - CustomAction ExeCommand - 隐藏控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经获得了一个运行命令行的自定义操作:

We've gotten a custom action that runs command-line to work as such:

<CustomAction Id="OurAction" 
              FileKey="OurInstalledExe.exe"
              ExeCommand="our command line args" 
              Execute="deferred" 
              Return="check" />

问题是,当命令运行时,用户会看到一个控制台弹出窗口.

The problem is, the user sees a console popup when the command runs.

命令行需要 UAC 提升,但不应需要任何用户交互.我们还使用 setup 安装文件,自定义操作运行 After="InstallFiles".

The command line requires UAC elevation, but should not require any user interaction. We also install the file with the setup, the custom action runs After="InstallFiles".

我们如何防止用户看到控制台?

How do we prevent the user from seeing the console?

推荐答案

请注意,如果您确实需要 UAC 提升,那么您需要确保它是延迟执行 CA.这是手册中添加了命令行参数的示例.

Note that if you do require UAC elevation, then you need to ensure that it's a deferred execution CA. Here's the example from the manual with command line arguments added.

<CustomAction Id="QtExecDeferredExampleWithProperty_Cmd" Property="QtExecDeferredExampleWithProperty"
              Value="&quot;[#MyExecutable.exe]&quot; /arguments" Execute="immediate"/>
<CustomAction Id="QtExecDeferredExampleWithProperty" BinaryKey="WixCA" DllEntry="CAQuietExec"
              Execute="deferred" Return="check" Impersonate="no"/>
.
.
.
<InstallExecuteSequence>
    <Custom Action="QtExecDeferredExampleWithProperty_Cmd" After="CostFinalize"/>
    <Custom Action="QtExecDeferredExampleWithProperty" After="TheActionYouWantItAfter"/>
</InstallExecuteSequence>

这篇关于WiX - CustomAction ExeCommand - 隐藏控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆