I am trying to run an MSI file from C# using the Proces.Start method. The MSI file is fine, because I can run that normally, but when I try to run the MSI file within some C
It is also possible to execute the .msi file directly with the associated application. This happens when you set UseShellExecute
to true
:
Process.Start(new ProcessStartInfo()
{
FileName = @"c:\somepath\mySetup.msi",
UseShellExecute = true
});
msi files cannot run on their own. If you double click on them, Windows will start
msiexec /i PathToYour.msi
Did you try to do that explicitly?
Example: (Courtesy @Webleeuw)
Process p = new Process();
p.StartInfo.FileName = "msiexec";
p.StartInfo.Arguments = "/i PathToYour.msi";
p.Start();
Addition to question poster's comment on Benjamin's answer:
Process p = new Process();
p.StartInfo.FileName = "msiexec";
p.StartInfo.Arguments = "/i PathToYour.msi";
p.Start();