Majorupgrade或Upgrade ID,哪个是Major Upgrade首选? [英] Majorupgrade or Upgrade ID which is preferred for Major upgrade?

查看:225
本文介绍了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." />

旧方法不仅更加冗长,而且还要求您重复

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首选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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