Wix重大升级,无论新文件版本如何替换文件 [英] Wix major upgrade, replace files regardless of newer file version

查看:189
本文介绍了Wix重大升级,无论新文件版本如何替换文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的WiX安装程序(Wix 3.10,MSI 4.5)使用MajorUpgrade进行更新.在预构建中,将使用heat.exe收获要安装的文件.当前(较旧的)msi文件包含文件nlog.dll(NuGet软件包v4.1.0随附),该文件的文件版本为4.1.0.0,产品版本为4.1.0,上次写入时间为2015-09-01.

My WiX installer (Wix 3.10, MSI 4.5) uses MajorUpgrade for updating. The files to be installed are harvested with heat.exe in pre-build. The current (older) msi file contains a file nlog.dll (which came with a NuGet package v4.1.0) that has a file version of 4.1.0.0, a product version of 4.1.0 and last write time of 2015-09-01.

由于nlog团队遇到了一些严重的命名问题,因此他们发布了更新的NuGet软件包v4.1.1,其中包含更新的nlog.dll ,其文件版本降为4.0.0.0 版本已增加到4.1.1,上次写入时间是2015-09-14.

Since the nlog team ran into some strong naming issues, they published an updated NuGet package v4.1.1, containing an updated nlog.dll with its file version decreased back to 4.0.0.0 while its product version has been increased to 4.1.1, last write time is 2015-09-14.

现在,我像罗比一样在这里遇到了一个相关问题: wix重大升级未安装所有文件:安装新的msi软件包并执行重大升级时,当前的nlog.dll(根据其文件版本较新,但根据其文件日期和产品版本较旧)已删除,但未安装新的nlog.dll.

Now I'm running into a related issue as Robbie did here: wix major upgrade not installing all files: When I install the new msi package and the major upgrade is performed, the present nlog.dll (which is newer according to its file version, but older according to its file date and product version) is being removed, but the new nlog.dll isn't installed.

但是,按建议使用Schedule="afterInstallExecute"Schedule="afterInstallFinalize"不会帮我这个忙.不会像Robbie那样删除较新的文件并且不安装较旧的文件,它不会覆盖当前文件,而是将其保留在原位.

However, using Schedule="afterInstallExecute" or Schedule="afterInstallFinalize" as suggested won't do the trick for me. Instead of removing the newer file and not installing the older one as in Robbie's case, it doesn't overwrite the present file, and just leaves it in place.

长话短说,我希望我的安装程序仅安装其附带的所有文件,而不管文件/产品/程序集的版本控制如何.在有效的情况下,需要用较旧的文件替换较新的文件.您不能仅告诉安装程序引擎忽略文件版本/日期吗?如果没有,我有什么选择?

Long story short, I would like my installer to simply install all files that come with it, regardless of any file/product/assembly versioning stuff. There are valid circumstances in which replacing a newer file with an older one is desired. Can't you just tell the installer engine to ignore file versions/dates? If not, what are my options?

推荐答案

您可以将REINSTALLMODE属性设置为AMUS而不是OMUS.这将全局影响所有组件.

You can set the REINSTALLMODE property to AMUS instead of OMUS. This will affect all components globally.

另一个技巧是使用版本说谎".您可以在此处创作具有更高版本的file元素.使用热量会使这变得困难,因为现在您必须在编译XML之前对其进行转换.

The other trick is to use "version lying". This is where you author the file element with a higher version. Using heat can make this difficult as now you have to transform the XML before compiling it.

当然,真正的解决方案是打败nlog团队.但是根据我多年来从他们那里看到的情况,这将永远不会发生.也许您只是使用资源编辑器来破解DLL并修复"版本号.假设您不需要强命名.这感觉很脏,但对我来说可能是CM的噩梦.

Of course the real solution is to hit the nlog team over the head. But based on what I've seen from them over the years it'll never happen. Perhaps you just use a resource editor to hack the DLL and 'fix' the version #. That's assuming you don't need it strong named. This feels dirty and a possible CM nightmare to me though.

或者只是转储nlog. :)

Or just dump nlog. :)

这篇关于Wix重大升级,无论新文件版本如何替换文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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