C# Code to install MSI silently and know when it is done
If you want to install an application that is packaged as an .MSI and you want to know when the application has finished installing, use this code:
string installerFilePath; installerFilePath = "C:\\Program Files\\CCS\\Downloads\\CCSRPTSetup.msi";
System.Diagnostics.Process installerProcess;
installerProcess = System.Diagnostics.Process.Start(installerFilePath, "/q");
while (installerProcess.HasExited==false)
{
Application.DoEvents(); System.Threading.Thread.Sleep(250);
}
MessageBox.Show("done installing");