Msiexec:安装失败时自动回滚到以前的版本 [英] Msiexec: automatic rollback to previous version on installation failure

查看:137
本文介绍了Msiexec:安装失败时自动回滚到以前的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在静默模式下使用msiexec安装.MSI文件时,是否可以自动执行该文件,以便在安装失败时回滚到以前的版本?假设在安装时已经安装了较旧的应用程序版本.

When installing a .MSI file using msiexec in silent mode, is it possible to automate it such that on installation failure it rollbacks to the previous version? Assuming that on installation an older application version is already installed.

推荐答案

是的,在安装失败时通过回滚来恢复旧的应用程序版本实际上是Windows Installer的内置功能. ,但是您需要正确配置一些东西才能使其按需运行.

Yes, restoring the old application version via rollback upon an installation failure is actually a built-in feature of Windows Installer, but you need to configure things correctly to get it to work as you require.

Windows Installer回滚将按您的要求进行操作: 1)次要升级 2)顺序正确的主要升级成功更新所有文件后,卸载旧版本.如果将主要升级设置为在安装新版本之前先卸载旧版本,则由于已完成卸载,因此无法使用回滚,因此,如果新安装程序失败并回滚,则将不进行任何安装.

Windows Installer rollback will work as you request if you use: 1) a minor upgrade or 2) a properly sequenced major upgrade that uninstalls the older versions after successfully updating all files. If the major upgrade is set to uninstall the old version before installing the new, the rollback is not available since the uninstall is already over, and the new installer will hence leave nothing installed if it fails and rolls back.

重要:为了使次要升级和要在主要升级中较晚卸载旧版本以使其正常工作,必须严格100%遵循所有 MSI组件规则.

Important: For minor upgrades and for late uninstall of old version in major upgrades to work correctly, all MSI component rules must be followed 100% accurately.

考虑要在更新后卸载旧版本的重大升级时,您可以将其视为修补操作,而无需将更新打包为修补程序. Windows Installer实际上将在新旧版本上运行差异,然后仅实施所需的更改,而其余应用程序则保持不变.根据应用程序结构和文件数量的不同,此的安装速度也可能明显更快.

When thinking about a major upgrade that uninstalls the old version after updating, you can view it as a patching operation without having the update packaged as a patch. Windows Installer will actually run a diff on the old and new version and then implement only the required changes, leaving the rest of the application untouched. Depending on the application structure and number of files, this can be significantly faster to install as well.

顺序较大的升级也是一种防止配置文件在升级过程中还原为原始安装状态的方法.这是一个经典的问题,在安装后更改配置文件,在重大升级过程中将其卸载,然后重新安装,给人的印象是,在实际重新安装它们时,它们已经还原.

Late-sequenced major upgrades are also a way to prevent configuration files from being reverted to their original installation status during upgrades. This is a classic issue where config files are changed after installation, uninstalled during a major upgrade and then being reinstalled giving the impression that they are reverted, when they are actually freshly reinstalled.

我之前已经写过有关 Windows Installer回滚 的文章.可能值得一读.

I have written about Windows Installer Rollback before. Might be worth a read.

这篇关于Msiexec:安装失败时自动回滚到以前的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆