主要升级首选的主要升级或升级 ID? [英] Majorupgrade or Upgrade ID which is preferred for Major upgrade?

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

问题描述

我们正在尝试进行重大升级.在我进行调查时,我发现了 2 种方法.

We are trying to do Major upgrade. While i was investigating i found 2 approaches.

一种是使用升级 ID,另一种方法是 Majorupgrade 标签.

One is using Upgrade Id and another one approach was Majorupgrade tag.

看起来 Majorupgrade 似乎很容易做到.但 schedule 不包含任何 before installinitialize 操作.

It seems Majorupgrade is easy to do it seems. But schedule doesn't contain any before installinitialize action.

我不确定应该使用哪个.

I am not sure which should be using .

最喜欢[和推荐]哪一个?

Which one is preferred [and recommended] mostly?

推荐答案

引入了 MajorUpgrade 元素在 wix 3.5 中简化您通常使用 Upgrade 元素所做的事情.所以不是这样的:

The MajorUpgrade element was introduced in wix 3.5 to simplify what you would normally do with the Upgrade element. So that instead of something like this:

<!– Major upgrade –> 
<Upgrade Id="$(var.UpgradeCode)"> 
    <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" /> 
    <UpgradeVersion Minimum="1.0.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" /> 
</Upgrade>

<InstallExecuteSequence> 
    <RemoveExistingProducts After="InstallValidate" /> 
</InstallExecuteSequence>

<Condition Message="Can't downgrade"> 
    NOT NEWERVERSIONDETECTED 
</Condition>

你可以这样做:

<MajorUpgrade DowngradeErrorMessage="Can’t downgrade." />

旧方法不仅更加冗长,还需要您重复 产品元素.所以上面的示例必须使用 wix 变量来保持它们同步.如果你弄错了,升级将无法正常工作.

Not only is the old way more verbose, it also requires that you repeat the upgrade code and product version which are specified in the Product element. So the sample above has to make use of wix variables to keep them in sync. If you get that wrong, the upgrade won't work correctly.

新的 MajorUpgrade 元素没有这些复杂性,因此我建议您使用它.另请参阅 Bob Arnson 介绍的 博文介绍 MajorUpgradewix 文档中的主题 关于该主题.

The new MajorUpgrade element has none of those complications, so I recommend that you use it. See also this blog post by Bob Arnson introducing MajorUpgrade and the topic in the wix documentation on the subject.

这篇关于主要升级首选的主要升级或升级 ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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