Wix 操作 FindRelatedProducts 不起作用

发布于 2024-09-27 09:48:45 字数 1240 浏览 0 评论 0原文

这可能是一个愚蠢的问题。

我们做了什么

我们只是想使用FindRelatedProducts操作来检查现有安装的版本,按照Wix教程:

<Upgrade Id='YOURGUID-7349-453F-94F6-BCB5110BA4FD'>
  <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND'
    Minimum='1.0.1' IncludeMinimum='yes'
    Maximum='1.0.1' IncludeMaximum='yes' />
  <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
    Minimum='1.0.1' IncludeMinimum='no' />
</Upgrade>
...
<CustomAction Id='AlreadyUpdated' Error='Foobar 1.0 has already been updated to 1.0.1 or newer.' />
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />

<InstallExecuteSequence>
  <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
  <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
</InstallExecuteSequence>

我们得到的

  • 如果没有安装版本,FindRelatedProducts可以检测到没有安装存在,但
  • 如果1.0.1存在,安装1.0.0时,应该检测到更高版本号的现有安装,并弹出err msg,但事实并非如此。

我们使用Orca检查.msi文件(1.0.0和1.0.1)的安装条目信息,两者的属性都是正确的。

我们使用 msiexec /a foo_1.0.x.msi /l* foo_1.0.x.log 来获取日志,但发现 NEWERFOUND 属性未设置!

我们做错了什么?

This could be a stupid question.

What we did

We just want to use FindRelatedProducts action to check existing installation's version, by following Wix tutorial:

<Upgrade Id='YOURGUID-7349-453F-94F6-BCB5110BA4FD'>
  <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND'
    Minimum='1.0.1' IncludeMinimum='yes'
    Maximum='1.0.1' IncludeMaximum='yes' />
  <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
    Minimum='1.0.1' IncludeMinimum='no' />
</Upgrade>
...
<CustomAction Id='AlreadyUpdated' Error='Foobar 1.0 has already been updated to 1.0.1 or newer.' />
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />

<InstallExecuteSequence>
  <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
  <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
</InstallExecuteSequence>

What we get

  • if no version was installed, FindRelatedProducts can detect that no installation exists, but
  • if 1.0.1 exists, when install 1.0.0, existing installation with higher version number should be detected, and err msg pop up, but it doesn't.

We used Orca to check the installation entry info on .msi files (1.0.0 and 1.0.1), properties of both are correct.

We used msiexec /a foo_1.0.x.msi /l* foo_1.0.x.log to get the log, but found the NEWERFOUND property is NOT set!

What we did wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

生寂 2024-10-04 09:48:45

确保 1.0.0 软件包和 1.0.1 软件包以及 Upgrade/@Id 属性中的 UpgradeCode 相同。

Make sure the UpgradeCode is the same for both 1.0.0 package and 1.0.1 package and in Upgrade/@Id attribute.

述情 2024-10-04 09:48:45

是的,我已经尝试了 WiX 教程 中的示例,替换 YOURGUID** * 使用真实的 GUID,该示例不起作用,我仍然可以在新版本上安装旧版本,降级检查机制似乎不起作用。

YES, I have try the example from WiX tutorial, replace YOURGUID*** with real GUID, the example doesn't work, I still can install old version over the new version, the downgrade check mechanism seems do not work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文