未安装新组件的文件,因为存在具有相同文件的旧组件 [英] File of a new component isn't installed because there was an old component with the same file

查看:110
本文介绍了未安装新组件的文件,因为存在具有相同文件的旧组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个问题,即在进行重大更新时未安装国际剑联

We have a problem that a fie is not installed upon a major update

  • 我们对<MajorUpgrade Schedule="afterInstallInitialize"...
  • 进行了重大更新
  • 我们有一个来自外部制造商的带有1个文件(xyz.exe版本12.34)的旧组件
  • 我们现在有一个来自新制造商的新文件,并且具有相同的名称(xyz.exe版本2.34).新文件的版本号比旧文件的版本号低.
  • 我们在安装包中创建了一个新组件,并删除了旧组件(实际上,我们为其提供了新的向导)
  • 无法更改exe的名称,这将对文档和内部功能产生很大影响.
  • We have a major update with <MajorUpgrade Schedule="afterInstallInitialize"...
  • We an old component with 1 file (xyz.exe Version 12.34) from a external manufacturer
  • We have now a new file from a new manufacturer and with the same name (xyz.exe Version 2.34). The new file has a lower version number than the old one.
  • We created a new component in the install package and removed the old component (in fact we gave it a new guid)
  • Changing the name of the exe isn't possible, it would have to much influence upon documentation and internal functions.

在常规安装中,一切正常.

On a normal installation everything is OK.

但是现在更新发生了什么

But what happens now on an update:

  • 安装程序启动.
  • 并检测到该新组件(xyz.exe)具有较低版本,因此将不会安装.
  • 安装程序将运行并删除旧组件
  • 但是它没有安装新组件,因为它只是检测到该组件已经安装.
  • 进行修复安装可以解决此问题,并且该文件不再存在.

将KeyPath设置为Component可解决此问题.但这对我来说是错误的.安装此文件的目录是主安装目录.

Setting the KeyPath to the Component fixes the problem. But it seams wrong to me. The directory where this file is installed is the main installation directory.

如何强制安装此组件?

推荐答案

类似答案 :


主要升级降级 :为了覆盖主要升级中具有更高版本号的二进制文件,有一些选择.


Major Upgrade Downgrade: In order to overwrite binaries with higher version numbers on major upgrades there are a few options.

  • 首选方法是使用随播文件 (第三方文件).
  • 或者,如果您可以:编译具有更高版本号的新二进制文件(用于自己的文件).
  • The preferred approach would be to use a companion file (third party files).
  • Or if you can: compile a new binary with a higher version number (for your own files).

REINSTALLMODE :MSI属性可以使用REINSTALLMODE -但它有很多副作用:

REINSTALLMODE: The MSI property REINSTALLMODE can be used - but it has a number of side-effects:

设置1 :版本 1.0.0 用于设置:

Setup 1: Version 1.0.0 for a setup:

msiexec.exe /i Setup1.msi /qn

设置2 :主要升级设置的版本 2.0.0 :

Setup 2: Version 2.0.0 for the major upgrade setup:

msiexec.exe /i Setup2.msi REINSTALLMODE=amus /qn

几个问题 :REINSTALLMODE存在一些问题,使其使用起来不安全(请尝试使用 emus ?请参阅文档-也许蛮力的).可惜的是,此设置适用于设置中的所有功能-使其非常危险:

Several Problems: There are several issues with REINSTALLMODE that makes it an unsafe feature to use (try emus instead? See documentation - a little less brute force maybe). It is a shame that this setting applies to all features in the setup - that makes it very dangerous:

  • 可以在系统范围内降级共享文件(例如,如果包含合并模块,则可以降级)
  • 可能会导致版本属性不一致,因为可以在更新版本后安装旧软件包并仅降级某些共享文件
  • 可以降级或清除非版本文件中的设置(和注册表设置)
  • 由于试图不必要地替换相同版本的正在使用的文件,因此可能导致请求的重新启动次数大量增加.
  • 还有几个非常具体的问题

伴侣文件 :下面的代码段介绍了如何使用

Companion Files: A snippet below on how to use companion files in WiX:

<..>

<Component Id="MyFile.exe" Feature="Main">
  <File Id="MyFile.exe" Source="MyFile.exe"></File>
</Component>

<Component Id="MyFile_2.exe" Guid="{0EBDFD64-017B-428F-BB67-3D82EA2A99AF}" Feature="Main">
  <File Source="MyFile_2.exe" CompanionFile="MyFile.exe"></File>
</Component>

<..>

单行摘要 :在第二个组件中,我们指向第一个组件的文件,这样,只要 > MyFile.exe 已安装-不管版本问题.

One-Line Summary: In the second component we point to the first component's file so that MyFile_2.exe will install whenever MyFile.exe is installed - regardless of versioning issues.

Hack Binary Version :难看但有效选项是使用Visual Studio设置更高的版本号来更改二进制文件的版本.副作用有几种:

Hack Binary Version: An ugly, but effective option is to change the version of the binary file using Visual Studio to set a higher version number. Side effects are several:

  • 您破坏了数字签名
  • 您可以创建版本混淆"
  • 从Visual Studio编写新的二进制文件可能会有风险
  • 这是一个"hack手动步骤"-您可能需要对新版本继续这样做吗?
  • 等...

移动,重命名 :如果您可以通过重命名或移动新文件来使其与旧文件脱钩,则可以解决此问题.如果将来再次获得新版本,则可能必须再次执行此操作.笨拙的.

Move, Rename: If you can de-couple the new file from the old by renaming it or moving it you can work around the problem. If you get a new version again for the future, you might have to do this again. Clunky.

加载自" :将文件放在共享位置,然后从该特定位置加载,然后从安装文件夹中删除旧副本.那行得通吗?这意味着该文件也可以通过该位置的另一个设置来传递.

"Load From": Putting the file somewhere shared and load it from that specific location and removing the old copy from your installation folder. Could that work? This means the file could also be delivered by another setup at that location.

版本说谎 :在Installshield中,存在一个概念,即可以为文件设置特定的版本号.我不确定如何在WiX中实现该功能.还有一个始终覆盖选项" 显然为该版本设置了最大值,因此始终会覆盖现有文件.

Version Lying: In Installshield there is a concept of being able to set a specific version number to a file. I am not sure how to implement that in WiX. There is also an "always overwrite option" that apparently sets a maximum value for the version so the existing file is always overwritten.

某些链接 :

Some Links:

  • Why Windows Installer removes files during a major upgrade if they go backwards in version numbers
  • "Downgraded" MS dll disappears on upgrade - Windows Installer
  • Install a file regardless of version number with WiX
  • How to make better use of MSI files
  • The opposite side of it: file preservation and file overwrite rules.

这篇关于未安装新组件的文件,因为存在具有相同文件的旧组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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