我必须使用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#中的示例代码吗?
对此有何帮助?