0

I'm using Wix installer in which i use custom action to execute my exe(windows form) with command line arguments. I tried the following way in order to execute my custom action.

<CustomAction Id="ConnMgrCACmd" Property="ConnMgrCAWithProperty"
          Value="&quot;[#ConnectionManagerExe.exe]&quot; /COMMAND=ADD FILEPATH="[INSTALLDIR]" KEY="[DB_KEY]" Execute="immediate"/>
<CustomAction Id="ConnMgrCAWithProperty" BinaryKey="WixCA" DllEntry="CAQuietExec"
          Execute="deferred" Return="check" Impersonate="no"/>

But the above code is not working for me. Is my custom action is right?.

harocool
  • 41
  • 9
  • I suppose you should do extra quotes escaping around `[INSTALLDIR]` and `[DB_KEY]` – Yan Sklyarenko Jul 18 '12 at 07:11
  • Yeah I tried it is working. Could you tell me how to hide the console(.exe)? – harocool Jul 18 '12 at 07:37
  • well, actually this is what `CAQuietExec` is for - it should hide the console window... – Yan Sklyarenko Jul 18 '12 at 08:03
  • It seems my custom action is not able to pass the command line parameters to the exe. It worked for while but after that custom action failed and exit from the installer. Here is my complete code. – harocool Jul 18 '12 at 14:53
  • I can see you removed the quotes around INSTALLDIR, but if it contains spaces, this won't work. You'd rather escape those, the way you do for .exe itself, using " – Yan Sklyarenko Jul 18 '12 at 20:36
  • My INSTALLDIR value would be like C:\Program Files\Product Name. I tried to put like this FILEPATH="[INSTALLDIR]" but not working. Any Idea? – harocool Jul 19 '12 at 11:28
  • INSTALLDIR value should be look like "C:\Program Files\ Product Name" – harocool Jul 19 '12 at 12:07
  • Execute msi from command prompt with log and then search in the log for the custom action name. Log will provide the parameter names. then we can check where quotes are missing and then add them – Sunil Agarwal Jul 19 '12 at 19:45
  • Atlast it got worked. Thank you very much. – harocool Jul 20 '12 at 06:21

0 Answers0