问题描述
全部!
我正在使用动态库Microsoft.Deployment.WindowsInstaller.dll"(来自 Windows Installer XML,即 http://wixtoolset.org/),在我的 C# 项目中,以编程方式安装 MSI 包:
I am using the dynamic library "Microsoft.Deployment.WindowsInstaller.dll" (from Windows Installer XML, that is, http://wixtoolset.org/), in my C# project, to install a MSI package programatically:
using System;
using Microsoft.Deployment.WindowsInstaller;
private static void InstallWIXML(string msiPackage)
{
Installer.InstallProduct(msiPackage, "REBOOT=R");
}
.但我不知道如何使这个自动的、不可重启的、安静的安装.此 InstallWIXML
方法执行手动(取决于大小写!),不可重新启动,不安静(取决于大小写!),安装.
. But I don't know how to make this automatic, not restartable, quiet, installation. This InstallWIXML
method does a manual (it is case dependent!), not restartable, not quiet (it is case dependent!), installation.
感谢您的帮助!
推荐答案
我使用了以下代码,就像我对 Christopher Painter 的回答的评论一样:
I used the following code, like in my comment of the Christopher Painter's answer:
using System;
using Microsoft.Deployment.WindowsInstaller;
private static void InstallWIXML(string msiPackage)
{
Installer.SetInternalUI(InstallUIOptions.Silent);
Installer.InstallProduct(msiPackage, "REBOOT=R");
}
.它适用于我的问题.
也感谢 Christopher Painter 的回答和评论!
Thanks for the Christopher Painter's answer and comments, too!
这篇关于通过 Microsoft.Deployment.WindowsInstaller.dll (Windows Installer XML) 通过 Visual c# 应用程序在执行的 msi 安装上指定 quiet 和 norestart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!