了解 Windows Installer 文件表中的重要属性

发布于 2024-10-07 06:12:24 字数 283 浏览 0 评论 0原文

假设您有一个 MSI 尝试添加或替换文件 Foo.bar,但该操作失败。如果 Foo.bar 在 MSI 的文件表中被标记为重要(使用 msidbFileAttributesVital),则安装将回滚。如果该文件不重要,则会提示用户并允许其决定是否应忽略错误或是否应回滚安装。

如果操作失败并且安装程序以静默模式 (/qn) 运行怎么办?无法提示用户。

看起来(从我拥有的 MSI 日志来看)安装会回滚,即使该文件并不重要。在这种情况下,有什么方法可以进行静默安装吗?

Suppose you have an MSI that's trying to add or replace file Foo.bar, and that operation fails. If Foo.bar is marked as vital (with msidbFileAttributesVital) in the File table of the MSI, then the installation will roll back. If the file is not vital, then the user is prompted and allowed to decide if the error should be ignored or if the installation should be rolled back.

What if the operation fails and the installer is running in silent mode (/qn)? The user cannot be prompted.

It appears (from an MSI log I have) that the installation rolls back, even though the file is not vital. Is there some way to have a silent install proceed in this case?

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

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

发布评论

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

评论(1

ˇ宁静的妩媚 2024-10-14 06:12:25

据我所知,如果遇到错误,静默安装总是回滚,无论您使用什么标志和设置。这可以防止安装损坏(例如丢失文件)。

对于您的情况,解决方案是使用基本 UI 来提示用户。另一种解决方案是使用非 MSI 安装程序,它可以忽略安装错误。

From my knowledge silent installations always rollback if an error is encountered, no matter what flags and settings you use. This prevents broken installations (for example missing files).

In your case a solution is to use basic UI to prompt the user. Another solution is to use a non-MSI installer which can ignore installation errors.

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