I am trying to install MSI through code, and I came across this solution Programatically installing MSI packages
Code:
public static void Install()
{
try
{
Type type = Type.GetTypeFromProgID("WindowsInstaller.Installer");
Installer installer = (Installer)Activator.CreateInstance(type);
installer.InstallProduct("D:\\Applications\\TortoiseSVN-1.9.3.27038-x64-svn-1.9.3", "ACTION=INSTALL");
}
catch(Exception e)
{
Utilities.showErrorMessageBox(e.Message);
}
}
The exception I get has this non descriptive message: {"InstallProduct,PackagePath,PropertyValues"}
I don't know what sense to make of it. I have also tried various combinations of PropertyValues but to no avail.
Can someone explain the reason behind this error?
EDIT
Using the following works:
System.Diagnostics.Process.Start("D:\\Applications\\TortoiseSVN-1.9.3.27038-x64-svn-1.9.3.msi");
So, is this method as fine as using the Installer?