Windows 安装程序在产品升级期间删除版本控制文件,而不是降级它 [英] Windows installer deletes versioned file during product upgrade, instead of downgrading it

查看:13
本文介绍了Windows 安装程序在产品升级期间删除版本控制文件,而不是降级它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 wix 来创建我们的设置.对于升级,我们使用 Rob Mensching 的回答.(在较新的 wix 版本中,您可以使用 MajorUpgrade 元素.)这通常效果很好.删除旧产品,然后安装新产品.

We use wix to create our setups. For upgrading, we use major upgrades as demonstrated in this answer by Rob Mensching. (In newer wix versions you can use the MajorUpgrade element.) This normally works well. The old product is removed, then the new product is installed.

但是,显然上述不完全等同于手动卸载旧产品,然后手动安装新产品.

However, apparently the above is not completely equivalent to manually uninstalling the old product and then manually installing the new product.

例如考虑以下场景:

  • 我们产品的 1.0 版本已发布,包含第三方 dll 的 5.0 版本
  • 我们产品的 1.1 版本发布,包含相同第三方 dll 的 5.1 版本
  • 我们的产品发布了1.2版本,再次降级到第三方dll的5.0版本,因为我们发现新版本引入的问题比解决的问题多.

显然使用上面链接的 wix 升级逻辑,当从 1.1 版升级到 1.2 版时,3rdparty dll 将消失.需要维修才能恢复它.

Apparently with the wix upgrade logic linked above, the 3rdparty dll will disappear when upgrading from release 1.1 to 1.2. A repair is necessary to restore it.

是否有另一种升级方式适用于这种情况?我想我正在寻找的是允许组件降级的升级逻辑,就像手动卸载旧产品然后手动安装新产品一样.

Is there another way to upgrade, which would work for this scenario? I guess what I am looking for is upgrade logic which allows the downgrading of components, by behaving exactly as if one manually uninstalls the old product and then manually installs the new product.

推荐答案

我们也遇到了这个问题,即低版本的 DLL 在重大升级时没有重新安装.我觉得奇怪的是安装程序会根据现有文件的版本决定安装哪些文件,然后完全卸载所有内容,但仍然只安装之前确定要安装的文件卸载旧产品.这似乎是 Windows Installer 中的一个错误...

We also encountered this problem where lower-versioned DLLs were not getting reinstalled on a major upgrade. I thought it was strange that the installer would decide which files to install based on the versioning of existing files, then completely uninstall everything, but still only install what what files had been determined to install before uninstalling the old product. This seems like it might be a bug in Windows Installer...

为了解决这个问题,我们将 RemoveExistingProducts 操作移到 CostFinalize 操作上方.

To fix this problem we moved the RemoveExistingProducts action above the CostFinalize action.

我知道 MSDN 上的文档 建议将 RemoveExistingProducts 放在 InstallValidate 之后,我不确定将它放在 InstallValidate 操作之前是否会对小升级产生任何负面影响,但我们决定只对我们的产品进行重大升级,因此这个解决方案似乎对我们有用.

I know the documentation on MSDN recommends placing the RemoveExistingProducts afterInstallValidate, and I'm not sure if putting it before the InstallValidate action has any negative side effects for minor upgrades, but we have decided to only perform major upgrades for our products so this solution appears to work for us.

这篇关于Windows 安装程序在产品升级期间删除版本控制文件,而不是降级它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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