Is it Possible to install the .msi from web application?

Mar 8 2017 7:46 AM
My msi file is on server and through web application i want to install that file silently.
 
The code which  have tried is working on my system but after hosting on iis it is not working. 
 
I had tried following Code:
 
string filepath = Server.MapPath("~/NewFolder1/Test.msi");
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('"+filepath+"')", true);
System.Diagnostics.Process process=null;
try
{
process = new System.Diagnostics.Process();
}
catch (Exception ex)
{
}
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
startInfo.FileName = "cmd.exe";
// startInfo.Arguments = "/K msiexec.exe /i \"" + @"D:\Datta\CrispDoxCompression.msi" + "\" /quite /qn";
startInfo.Arguments = "/K msiexec.exe /i \"" + filepath + "\" /qn";
startInfo.Verb = "runas";
process.StartInfo = startInfo;
process.Start();
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('2')", true);
 

Answers (1)