使用c#.net静默安装exe文件 [英] silent installation of exe file using c#.net

查看:1014
本文介绍了使用c#.net静默安装exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用c#.net。我试图将exe文件安装到我的系统而不按下一个按钮。我如何通过编程方式在c#



处理这个问题。有任何想法请帮助我....


I am working with c#.net. I am trying to install the exe file into my system without pressing the next button. How can i approach this one through programatically in c#

any ideas with this please help me....

推荐答案

考虑自动 [ ^ ]


C#代码以静默方式安装MSI并知道何时完成



如果要安装打包为.MSI的应用程序,并且想知道应用程序何时完成安装,请使用以下代码:

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) 
{ 
//indicate progress to user 
Application.DoEvents(); System.Threading.Thread.Sleep(250); 
} 
MessageBox.Show("done installing");


上述解决方案不适用于setup.exe文件。我在很多地方看到了这样的解决方案,但是没有看到通过setup.exe进行安装。
Above solution doesn't work for setup.exe file. I see such solutions in many places, but don't see any for installing via setup.exe.


这篇关于使用c#.net静默安装exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆