Majorupgrade或Upgrade ID,哪个是Major Upgrade首选?

编程入门 行业动态 更新时间:2024-10-25 10:29:20
本文介绍了Majorupgrade或Upgrade ID,哪个是Major Upgrade首选?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们正在尝试进行重大升级.在调查过程中,我发现了两种方法.

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在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中简化了通常使用升级元素的操作.因此,而不是像这样的东西:

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>

您可以简单地执行以下操作:

You can simply do this:

<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)的博客文章,介绍MajorUpgrade 和有关主题的主题在wix文档中.

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.

更多推荐

Majorupgrade或Upgrade ID,哪个是Major Upgrade首选?

本文发布于:2023-10-18 12:46:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504269.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:首选   Upgrade   Majorupgrade   Major   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!