title: passing msiexec command line params to a child process started by msiexec
body: <p>I  have a requirement to update config files with the command line provided arguments for some reason, the file is not being updated so I wrote a small utility app in c# to be started by msiexec. The intention is to get the commandline params to this app so that it would open the config file and update it during the course of installation.</p>
  
  <p>My app was executed fine but when trying to read the parent process (msiexec) command line params, I get something like <code>C:\windows\msiexec /V</code> not the ones I specify on the msiexec command line (I'm not even using <code>/V</code>)</p>
  
  <p>Any ideas about what could be the issue? If you have a better way to handle this please suggest.</p>
  
  <p>Thanks.</p>
  
  <p><strong>Update:</strong><br>
  Sorry for the confusion, I was using WiX installer and I start the WiX generated .msi on the command line as below for eg. </p>
  
  <pre><code>C:\&gt; msiexec /I foo.msi ARG1="v1" ARG2="v2" 
  </code></pre>
  
  <p><code>ARG1</code> and <code>ARG2</code> are defined in Wix installer script.</p>
  
  <p>What I'm looking at is a way to access the command line params <code>ARG1="v1"</code>,  <code>ARG2="V"</code> by a small application which will be started by msiexec (the app is specified in Wix installer script as custom action).</p>
  
  <p>Ideally, when I use <code>xmlFile</code> (tried <code>xmlConfig</code> as well), my WiX installer script should be able to update my config files with <code>v1</code>, <code>v2</code> but its not happening so wrote an application that should be able to read <code>v1</code> &amp; <code>v2</code> and write to the config file.</p>
  
  <p>using <code>xmlFile</code> I get the following error:</p>
  
  <blockquote>
    <p>ExecXmlFile: Error 0x8007006e: failed to load XML file: Error 25531. Failed to open XML file , system error: -2147024786 MSI (s) (E4!54) [18:11:36:714]: Product: -- Error 25531. Failed to open XML file , system error: -2147024786 –</p>
  </blockquote>
  
  <p>Doesn't get any meaningful info. I used the msiexec argument <code>/l*v</code> to generate the logging.</p>
  
  <hr>
  
  <p>Log excerpt:</p>
  
  <p>Actually <code>xmlFile</code> should do my requirement but I get the following error while using it. Any help on this would be greatly appreciated.</p>
  
  <pre><code>MSI (s) (E4:00) [18:11:32:110]: Executing op: ActionStart(Name=ExecXmlFile,,) Action 18:11:32: ExecXmlFile.
  MSI (s) (E4:00) [18:11:32:111]: Executing op: CustomActionSchedule(Action=ExecXmlFile,ActionType=3073,Source=BinaryData,Target=ExecXmlFile,CustomActionData=1030//cloudRecognition/connectiontype130//cloudRecognition/connectionaddress192.168.128.59;192.168.128.261030//cloudRecognition/connectionport50001;50001)
  MSI (s) (E4:DC) [18:11:32:113]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIA419.tmp, Entrypoint: ExecXmlFile
  MSI (s) (E4:EC) [18:11:32:113]: Generating random cookie.
  MSI (s) (E4:EC) [18:11:32:115]: Created Custom Action Server with PID 10104 (0x2778).
  MSI (s) (E4:68) [18:11:32:402]: Running as a service.
  MSI (s) (E4:68) [18:11:32:403]: Hello, I'm your 32bit Elevated custom action server.
  ExecXmlFile:  Error 0x8007006e: failed to load XML file:
  Error 25531. Failed to open XML file , system error: -2147024786
  MSI (s) (E4!54) [18:11:36:714]: Product:  -- Error 25531. Failed to open XML file , system error: -2147024786
  </code></pre>
  
  <p>CustomAction <code>ExecXmlFile</code> returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) </p>