title: Using Microsoft.Deployment.WindowsInstaller.Installer.ConfigureProduct to uninstall silently?
body: <p>I can't make an uninstall using ConfigureProduct run quietly. I have the following:</p>
  
  <pre><code>using Microsoft.Deployment.WindowsInstaller;
  
  Installer.ConfigureProduct(productCode, 0, InstallState.Absent, "/q");
  </code></pre>
  
  <p>According to some earlier posts "/q" should work except I get the following exception every time I run the code.</p>
  
  <pre><code>"Invalid command line argument. Consult the Windows Installer SDK for detailed command line help."
  </code></pre>
  
  <p>Notice that "/q" does work when using msiexec.exe but I would like to do this using Microsoft.Deployment.WindowsInstaller.</p>
  
  <p>I have also tried setting the UI to silent with the following:</p>
  
  <pre><code>Installer.SetInternalUI(InstallUIOptions.Silent);
  Installer.ConfigureProduct(productCode, 0, InstallState.Absent, "");
  </code></pre>
  
  <p>But then I get the following exception:</p>
  
  <pre><code>"Fatal error during installation."
  </code></pre>
  
  <p>From the message I gather that SetInternalUI is for installations instead of uninstallations but not sure.</p>
  
  <p>I am using the DLL from the WiX 3.9 R2 installation which is version 2.0.50727.</p>
  
  <p>Any help is appreciated. Thanks!</p>
  
  <p><strong>EDIT</strong>: I looked a little closer at the comments for the "commandLine" parameter in the "ConfigureProduct" method.</p>
  
  <pre><code>    //   commandLine:
      //     Specifies the command line property settings. This should be a list of the
      //     format Property=Setting Property=Setting.
  </code></pre>
  
  <p>So basically no, you can't pass "/q", "/l", or anything else not in the form "Property=Setting". The example in the reference post linked in the answers seems to be wrong. (Or something changed between versions but I doubt it.)</p>