Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
943 views
in Technique[技术] by (71.8m points)

installation - WiX - CustomAction ExeCommand - Hide Console

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...