使用静默模式安装MSI的WPF应用程序,然后获取进度和状态消息

时间:2018-07-11 03:53:54

标签: c# wpf windows-installer msiexec

我必须使用WPF应用程序以静默方式安装MSI文件,并且需要显示安装进度和状态消息。我正在使用Microsoft.Deployment.WindowsInstaller程序集安装MSI,并且安装正确完成。

如何从上述程序集中获取安装进度和状态消息?还是有其他方法以静默方式安装msi并获得进度和状态消息以在WPF应用程序的UI中显示?

Installer.SetInternalUI(InstallUIOptions.Silent);
Installer.InstallProduct(sourcePath, "Arguments");

我查看了以下链接,

Get progress value and status of a MSI installation

https://docs.microsoft.com/en-us/windows/desktop/Msi/installer-function-reference

如何在WPF应用程序中使用它?在任何链接中都有C#中的示例代码吗?

对此有何帮助?

0 个答案:

没有答案