4

I am developing an MSI installer which includes a tool.exe file as a <Binary> element. At some point during installation, i need to run the tool.exe. So i have a custom action to execute it:

<CustomAction Id="RunToolExe"
                      BinaryKey="ToolExe"
                      ExeCommand=" -r 240 -name appservice"
                      Execute="immediate"
                      Return="check"
                    />

Then i schedule in <InstallExecuteSequence>

Problem: When the custom action runs, a cmd line window flashes very fast during installation. This is a bit unconfortable for the user. Is there way to hide this screen?

I can't use WixQuietExecCA beacuse there is no way i can reference the Binary tool.exe in Wix.

Herno
  • 1,497
  • 2
  • 21
  • 40

2 Answers2

2
<CustomAction Id="SettoolEXEPATH" Property="EXEPATH" Value="&quot;[INSTALLDIR]tool.exe&quot; <additional commands> Execute="immediate"/>

<CustomAction Id="EXEPATH" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>       

you can use WixQuietExecCA like in example shown above, schedule the custom actions accordingly. First action SettoolEXEPATH set the property EXEPATH to path of tool.exe, this property name is used as custom action id for WixQuietExecCA which acts as the command line parameters.

Sanketh P B
  • 394
  • 2
  • 16
  • The problem is that i do not want the "Tool.exe" binary file to be installed in the computer. I just want to execute it. – Herno Nov 27 '12 at 13:42
  • The solution proposed by @Sanketh P B risks destroying your registry. I am compiling my installers from the command line, and the 'DllEntry="CAQuietExec"' line put my registry in an irreparable state due to the installer installing fine, but not having the files required on the way out. I spent hours trying to fix this before finally recreating my VM. I should have had restore points, but of course I didn't (my VM's base settings were questionable). This wasted hours of my time before I finally gave up. Be careful! – Shadoninja Jun 16 '15 at 22:07
  • @Shadoninja : Using WixCAQuieExec won't corrupt any registry. It completely depends on what executable you run in that action. – Sanketh P B Nov 22 '15 at 01:15
0

Did you try to do like on this page, to run the CA in silent mode

Look at this link for RemoveFiles

CheGueVerra
  • 7,849
  • 4
  • 37
  • 49
  • 1
    Yes i have previously used the WixQuietExecCA but my issue is that i want to embed a binary file (.exe) and execute it during installation, but i don't want the ".exe" file to be installed in a folder. – Herno Nov 27 '12 at 13:43
  • Delete it after you have finish with it, in the right spot in your install sequence. – CheGueVerra Nov 27 '12 at 14:18
  • So i would have to install the .exe as a element, inside a . And before InstallFinalize action, i should execute a cmd line like "del [InstallDir]\tool.exe" ? – Herno Nov 27 '12 at 14:22
  • See the link I added to removeFiles – CheGueVerra Nov 27 '12 at 14:33
  • But RemoveFiles action is executed Before InstallFiles action, so there is no way to deploy the file, execute it and then remove it without changing the order of those two actions. The only option i see is removing the file using a custom action like a "cmd line delete file" – Herno Nov 27 '12 at 16:18
  • From MSDN: The RemoveFiles action removes files previously installed by the InstallFiles action. – CheGueVerra Nov 27 '12 at 17:08
  • That's correct, but that happens during "Uninstall". I need to execute my .exe file during "First Installation" and remove the .exe. The user must never see the .exe file. – Herno Nov 28 '12 at 13:59