silently execute a MSI package from C#

Posted by Keenan Molver on Stack Overflow See other posts from Stack Overflow or by Keenan Molver
Published on 2012-09-16T15:31:07Z Indexed on 2012/09/16 15:37 UTC
Read the original article Hit count: 181

Filed under:

Newbie question, let me try and make this as clear as possible. I have a program that needs to silently execute a msi package (well multiple but that's not the problem)

The MSI packages are contained in a folder located in the same directory as my program. I've given it a simple name of "InstallFiles" for the time being.

I'm not keen on using the full path name eg. C:\my program\another directory\another directory etc because it'll be put on multiple PC's, old and new, in which case the drive letter can change. So far I have:

install.StartInfo.FileName = "msiexec";
install.StartInfo.Arguments = "/i F:\\InstallFiles\\JRE.msi";
install.Start();
install.WaitForExit();

However, when its launched it only gives me the Windows Installer switch information and then terminates, how do I get it to run and how would I go about changing the file path?

© Stack Overflow or respective owner

Related posts about c#