Wix 操作 FindRelatedProducts 不起作用
这可能是一个愚蠢的问题。
我们做了什么
我们只是想使用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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保 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 inUpgrade/@Id
attribute.是的,我已经尝试了 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.