1

我已经安装了 1.1 版。我创建了 1.2 版的升级。在这两种产品中,我都有 2 个文件:

    <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 的全新安装中,它存在。什么会导致这种行为?

4

2 回答 2

0

One of the reasons why this happens is because the action RemoveExistingProducts is being executed after the installation package performed the upgrade. In this case, the MSI detects the file is the same as in previous version and then removes it. You could:

  1. Change order of RemoveExistingProducts
  2. Set the DLL to Shared

I'd recommend option one.

RemoveExistingProducts Element

于 2014-05-20T18:25:48.380 回答
0

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

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

假设第一次安装有 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 也会被删除。

于 2014-05-20T19:26:31.707 回答