c# run .msu 从代码安装

发布于 2024-12-23 03:18:42 字数 74 浏览 1 评论 0 原文

有没有办法从代码中静默运行 .msu 安装?

我知道使用 msi 文件是可能的,但是当我运行 .msu 时,它失败了。

Is there a way to run silently .msu installation from code?

I know it's possible with msi files, but when I run .msu, it fails.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七分※倦醒 2024-12-30 03:18:42

这取决于“来自代码”的含义。如果您愿意运行单独的 EXE(而不是调用 API),则可以使用 WUSA.exe 来安装 .MSU ​​文件。请参阅知识库文章 934307,
Windows Vista、Windows 7 中的 Windows Update 独立安装程序 (Wusa.exe) 和 of.msu 文件的说明、Windows Server 2008 和 Windows Server 2008 R2

/quiet:以安静模式运行 Wusa.exe,无需用户交互。当
工具以安静模式运行,无需用户交互即可运行。这
如果需要,计算机将重新启动。 [。 。 。 ]

/norestart:阻止Wusa.exe重新启动计算机。这
如果/quiet 开关不存在,/norestart 开关将被忽略。 [。
。 。 ]

例如,如果 Windows6.0-KB934307-x86.msu 文件位于
D:\934307 文件夹中,在命令提示符下键入以下命令
安装更新包:wusa.exe
D:\934307\Windows6.0-KB934307-x86.msu /quiet /norestart

It depends on what you mean by "from code". If you are willing to run a separate EXE (rather than invoke an API), then you can use WUSA.exe to install .MSU files. See KB 934307,
Description of the Windows Update Stand-alone Installer (Wusa.exe) and of.msu files in Windows Vista, Windows 7, Windows Server 2008 and in Windows Server 2008 R2.

/quiet: Run Wusa.exe in quiet mode without user interaction. When the
tool runs in quiet mode, it runs without user interaction. The
computer restarts if it is required. [ . . . ]

/norestart: Prevent Wusa.exe from restarting the computer. The
/norestart switch is ignored if the /quiet switch is not present. [ .
. . ]

For example, if the Windows6.0-KB934307-x86.msu file is in the
D:\934307 folder, type the following command at a command prompt to
install the update package: wusa.exe
D:\934307\Windows6.0-KB934307-x86.msu /quiet /norestart

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文