I can't make an uninstall using ConfigureProduct run quietly. I have the following:
using Microsoft.Deployment.WindowsInstaller;
Installer.ConfigureProduct(productCode, 0, InstallState.Absent, "/q");
According to some earlier posts "/q" should work except I get the following exception every time I run the code.
"Invalid command line argument. Consult the Windows Installer SDK for detailed command line help."
Notice that "/q" does work when using msiexec.exe but I would like to do this using Microsoft.Deployment.WindowsInstaller.
I have also tried setting the UI to silent with the following:
Installer.SetInternalUI(InstallUIOptions.Silent);
Installer.ConfigureProduct(productCode, 0, InstallState.Absent, "");
But then I get the following exception:
"Fatal error during installation."
From the message I gather that SetInternalUI is for installations instead of uninstallations but not sure.
I am using the DLL from the WiX 3.9 R2 installation which is version 2.0.50727.
Any help is appreciated. Thanks!
EDIT: I looked a little closer at the comments for the "commandLine" parameter in the "ConfigureProduct" method.
// commandLine:
// Specifies the command line property settings. This should be a list of the
// format Property=Setting Property=Setting.
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.)