Use the common sense, and tell me where is this file?
string filepath = Server.MapPath("~/NewFolder1/Test.msi");
Is it accessible locally? No. It is present on the server and the code,
Process.Start()
will be executed on the server as well. The client is barely the trigger in this case, and any action on the server-side will not tell him anything, and just as mentioned in Solution 1, the admins will also not let you execute an installer on their machine — by issuing a request.
Quote:
I am trying to install .exe from web application. when i run the application locally(from asp development server) it is installing properly.
Because, at that moment it will available on the same client machine, and things go well as you have the admin rights, and you know where the file is. That is why it works properly.
Quote:
But when i hosted on IIS it is not working.
No, application already was hosted using IIS (how else, would you run an ASP.NET application?) the only difference is that now your application is relying on the rights provided by hosting providers as well.
Never install an application, using an HTTP request, even if you know what is there. Most of the hosting service providers will believe it to be a malicious application and will immediately terminate the process, or worse, terminate the contract or subscription as well. The solution is, that you should contact the admins, or look at the add-ons provided in their control panel and select one from there. They will be happy with it, and your users will get the services as well.