升级后文件丢失 [英] File missing after upgrade

查看:26
本文介绍了升级后文件丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 1.1 版.我用 1.2 版创建了升级.在这两个产品中,我有 2 个文件:

I have installation of version 1.1. I created upgrade with version 1.2. In both products I have 2 files:

    <Component Win64="yes" Id="cmpFILE1" Guid="*">
  <File Id="filFILE1" KeyPath="yes" Source="$(var.BasePathCMP)\Performance.dll" />
</Component>
<Component Win64="yes" Id="cmpFILE2" Guid="*">
  <File Id="filFILE2" KeyPath="yes" Source="$(var.BasePathCMP)\LockLib.dll" />
</Component>

在升级过程中,LockLib.dll 被删除且未被替换.在 1.2 的全新安装中,它存在.什么会导致这种行为?

During the upgrade LockLib.dll is removed and not being replaced. In clean installation of 1.2 it is present. What can cause that behavior?

推荐答案

我认为您更改了 MSI(旧版和升级版)中文件的组件 guid.当 RemoveExistingProducts 接近安装结束时,升级的行为类似于合并,必要时覆盖文件并增加共享组件 guid 的引用计数.最后,REP 将删除旧产品并减少组件 guid 的引用计数.如果 guid 没有更多客户端,它将被删除.如果共享"文件的 guid 更改,它将不再有客户端并被删除.最后关于 REP 的事情是您必须遵循组件共享规则,但如果您在升级开始时对 REP 进行排序,则不需要.

I'm thinking you changed the component guid for a file that is in both MSIs, older and upgrade. When the RemoveExistingProducts is towards the end of the install the upgrade behaves like a merge, overwriting files if necessary and incrementing ref counts for shared component guids. At the end the REP is removing the old product and decrementing ref counts for the component guids. If there are no more clients for the guid it will be removed. If the guid of a "shared" file changed it will have no more clients and be removed. The thing about an REP at the end is that you must follow component sharing rules, but you don't if you sequence REP at the start of the upgrade.

我正在添加一个示例以供将来参考.

I'm adding an example for future reference.

假设第一次安装有 3 个文件 A、B、C 和三个 guid,分别为 1、2 和 3.您的升级具有相同的三个文件,但 guid 为 1、2 和 8.当 REP 结束时升级首先安装在旧产品上.Guid 1 和 2 的引用计数从 1 增加到 2.Guid 3 保持为 1.然后卸载旧产品.Guid 1 和 2 的 ref 倒计时为 1,它们仍在使用中,因此附加到组件 guid 的文件会保留下来.Guid 3 降为零,没有引用计数,因此组件被删除,但它附加到文件 C,因此即使您刚刚安装了 C,它也会被删除.

Say the first install has 3 files A, B, C, and three guids that are 1, 2 and 3. Your upgrade has the same three files but the guids are 1, 2 and 8. When REP is at the end the upgrade installs over the old product first. Guids 1 and 2 get their ref counts incremented from 1 to 2. Guid 3 stays at 1. Then the older product is uninstalled. Guids 1 and 2 get ref counted down to 1, they are still in use so the files attached to the component guids stay. Guid 3 goes down to zero, has no ref counts so the component is removed, but it's attached to file C so C gets removed even though you just installed it.

这篇关于升级后文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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