0

I have this installer through which I'm installing Mosquitto as a re-requisite for my system. But after installation I need to run the EXE passing two parameters. The command to run would be "mosquitto -v -c mosquitto.conf". I tried to do this using the following command but nothing happens.

<Property Id="WixShellExecTarget" Value="[mosquitto.exe] -v -c mosquitto.conf" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />

<InstallExecuteSequence>
  <Custom Action="RunMosquitto" Before="InstallFinalize" />
</InstallExecuteSequence>

what is the right way to do this? Also I need to stop this EXE during uninstallation. How can I do that as well? Any help would be much appreciated. Thanks.

AnOldSoul
  • 4,017
  • 12
  • 57
  • 118

1 Answers1

1

No, according to this WiX mailing list archive.

Bob Arnson, one of the WiX developers, said the following:

WixShellExecTarget must be only the path of the executable/document. There's no support to add arguments. For that, use a "normal" exe custom action instead of WixShellExec.

BryanJ
  • 8,485
  • 1
  • 42
  • 61
  • If I use the normal exe custom action it opens a console. Isn't there a way to run the thing in background? – AnOldSoul Jul 01 '16 at 13:05
  • I think you'd probably have to write a custom action that called into code that did that. http://stackoverflow.com/questions/836427/how-to-run-a-c-sharp-console-application-with-the-console-hidden – BryanJ Jul 01 '16 at 13:51