安装Microsoft Installer程序 [英] Installing Microsoft Installer programs

查看:68
本文介绍了安装Microsoft Installer程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将编写C#程序,该程序将从我正在编写的C#程序中安装第三方.msi文件.我需要一些帮助来监视第三方.msi文件的安装状态.

I will be writing a C# program will install a third party .msi file from within the C# program I''m writing. I''m needing some help with monitoring the status of the installation of the third party .msi file.

推荐答案

通常,任何必要的注册表项都由Windows Installer完成基于.msi文件中的信息.


发表评论后:
我认为如果您编辑了原始问题以弄清楚它是第三方.msi文件还是您自己的一个文件,它将帮助其他人为您提供帮助.另外,您指的是C#程序?您是说要编写一个程序来检查.msi的进度吗?
[/Edit]
Normally any necessary registry entries are done by the Windows Installer based on information in the .msi file.


After your comment:
I think it would assist others to help you if you edited your original question to make it clear if it is a third-party .msi file or one of your own. Also what is the C# program you are referring to? Do you mean that you want to write a program to check on the progress of the .msi?
[/Edit]


在这种情况下,您可以执行以下操作:
1.创建一个System.Diagnostic.Process并将其设置为要执行的msi的文件路径.
2.创建一个while循环,该循环检查Process.HasExited属性以查看安装是否完成
3. HasExited == true
后,修改您的注册表项
In this case you could do the following:
1. Create a System.Diagnostic.Process and set it to the file path of the msi you are going to execute.
2. Create a while loop that checks the Process.HasExited property to see if the installation is complete
3. Modify your registry entries once the HasExited == true

System.Diagnostics.Process msi_installer = System.Diagnostics.Process.Start ( @"C:\path\filename.msi" );

       while ( !msi_installer.HasExited )
       {
           Application.DoEvents (); // prevent your appfrom freezing while it waits
           System.Threading.Thread.Sleep ( 300 ); // wait 300 milliseconds before checking again
       }

       // add code to modify registry entries here


这篇关于安装Microsoft Installer程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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