WiX 升级问题 - 文件的主要版本已增加,但修订版本较低,现在旧文件已删除,但升级期间未复制新文件 [英] WiX upgrade question - file's major version was incremented, but revision is lower, now old file removed, yet new file is not copied during upgrade

查看:20
本文介绍了WiX 升级问题 - 文件的主要版本已增加,但修订版本较低,现在旧文件已删除,但升级期间未复制新文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会根据目录(用于 Web 应用程序)为我的安装程序自动生成一个 WiX 文件,其中包含对以下 3 个 .Net 程序集的引用:

I automatically generate a WiX file for my installer based on a directory (it's for a web app), and it includes references to the following 3 .Net assemblies:

  • Migrator.dll
  • Migrator.Framework.dll
  • Migrator.Providers.dll

这里是生成的 WiX 片段:

And here is the generate WiX fragments:

<Fragment>
<DirectoryRef Id="bin">
  <Component Id="bin.Migrator.dll" Guid="*">
    <File Id="bin.Migrator.dll" Name="Migrator.dll" KeyPath="yes" Source="..WebApplicationinMigrator.dll" />
  </Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="bin">
  <Component Id="bin.Migrator.Framework.dll" Guid="*">
    <File Id="bin.Migrator.Framework.dll" Name="Migrator.Framework.dll" KeyPath="yes" Source="..WebApplicationinMigrator.Framework.dll" />
  </Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="bin">
  <Component Id="bin.Migrator.Providers.dll" Guid="*">
    <File Id="bin.Migrator.Providers.dll" Name="Migrator.Providers.dll" KeyPath="yes" Source="..WebApplicationinMigrator.Providers.dll" />
  </Component>
</DirectoryRef>
</Fragment>

一年左右我们一直在使用相同的基本安装程序结构,但最近我们将 Migrator.Net 库更新为一个新的内部构建,它看到版本号和程序集标题/描述属性从 (dumped out逆戟鲸)

We have been using the same basic installer structure for a year or so, but recently we updated the Migrator.Net libraries to a new in-house build that saw the version numbers and assembly title/description attributes change from (dumped out of Orca)

  • bin.Migrator.dll bin.Migrator.dll Migrator.dll 16384 3.0.1317.0 0 512 78
  • bin.Migrator.Framework.dll bin.Migrator.Framework.dll pi0mozkr.dll|Migrator.Framework.dll 20992 3.0.1317.0 0 512 79
  • bin.Migrator.Providers.dll bin.Migrator.Providers.dll jq05waoy.dll|Migrator.Providers.dll 73216 3.0.1317.0 0 512 82

升级库后:

  • bin.Migrator.dll bin.Migrator.dll Migrator.dll 16384 3.2.0.1 0 512 55
  • bin.Migrator.Framework.dll bin.Migrator.Framework.dll pi0mozkr.dll|Migrator.Framework.dll 28160 3.2.0.1 0 512 56
  • bin.Migrator.Providers.dll bin.Migrator.Providers.dll jq05waoy.dll|Migrator.Providers.dll 79872 3.2.0.1 0 512 57

虽然次要版本更高,但现在的修订版本是 1 而不是 1317.

Though the minor version is higher, the revision is now 1 instead of 1317.

从那以后我们发现升级到新版本会导致这3个文件没有被复制(所以升级过程会删除旧文件,但不会安装新文件).

Since then we have found that upgrading to the new version results in these 3 files not being copied (so the upgrade process removes the old files, but does not install the new files).

这是否与程序集的版本号更改有关,如果是的话,是否有任何方法可以覆盖此行为(我们只想删除所有内容,然后复制所有内容,无论版本如何).

Would this be related to the version number of the assemblies changing, and if so is there any way to override this behavior (we just want to remove everything, then copy everything fresh, regardless of version).

有趣的是,如果您安装,然后重新运行安装程序并进行修复",它确实会复制新文件 - 我认为这是因为修复文件时不再存在,因此文件版本检查逻辑不会不申请?

Interestingly if you install, then re-run the installer and do a "repair" it does copy the new files across - I assume this is because when repairing the file is no longer there, so the file version check logic doesn't apply?

任何有关其工作原理以及如何避免我们遇到的升级问题的提示将不胜感激.

Any hints as to both how this works, and how to avoid the upgrade issue we are having would be greatly appreciated.

推荐答案

As 链接问题建议,你可以尝试重新安排 RemoveExistingProducts 以便在安装任何新文件之前删除旧产品,如下所示:

As the linked question suggests, you can try to re-schedule RemoveExistingProducts so that the old product is removed before any new files are installed, like this:

<InstallExecuteSequence>
    <RemoveExistingProducts After="InstallValidate" />
    <!-- other actions -->
</InstallExecuteSequence>

另一种选择是修改 REINSTALLMODE 属性,并将 e 模式替换为 a,即其值为 amus.这样所有文件都将重新安装,操作时间会更长,但更可靠.

Another option is to modify REINSTALLMODE property, and replace e mode with a, that means its value would be amus. This way all the files will be re-installed, the operation would take longer but rather more reliable.

这篇关于WiX 升级问题 - 文件的主要版本已增加,但修订版本较低,现在旧文件已删除,但升级期间未复制新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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