[英]remove program from programs and features when installing newer version msi using wix
I am creating my installer msi using WIX. 我正在使用WIX创建安装程序msi。 My older application is already installed on machine when I am installing newer version of the application then it removes all files and assembly of older version and put newer version files and assembly but in programs and features of control panel shows both older and newer version.
当我安装较新版本的应用程序时,我的较旧应用程序已安装在计算机上,然后它删除了较旧版本的所有文件和程序集,并将较新版本的文件和程序集放入其中,但在控制面板的程序和功能中同时显示了较新版本和较旧版本。
I am using following code for upgrade 我正在使用以下代码进行升级
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Minimum="$(var.ProductVersion)" IncludeMinimum="no" OnlyDetect="yes" Language="!(loc.lcid)" Property="NEWPRODUCTFOUND"/>
<UpgradeVersion Minimum="1.0.0.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Language="!(loc.lcid)" Property="UPGRADEFOUND"/>
</Upgrade>
<CustomAction Id="PreventDowngrading" Error="!(loc.CustomAction_PreventDowngrading)"/>
<InstallUISequence>
<Custom Action="SetWindowsTypeProp" Before="FindRelatedProducts">1</Custom>
<!--Custom Action="SetPresenceProperties" After="SetWindowsTypeProp">1</Custom-->
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
<RemoveExistingProducts Before="InstallInitialize"/>
</InstallExecuteSequence>
Please help me how to remove entry from programs and features 请帮助我如何从程序和功能中删除条目
This means your MajorUpgrade isn't working. 这意味着您的MajorUpgrade无法正常工作。 FindRelatedProducts isn't finding the older version and therefore REmoveExistingProducts isn't working.
FindRelatedProducts找不到较旧的版本,因此REmoveExistingProducts无法正常工作。 For recent versions of WiX you can remove a lot of this code and replace it with the newer MajorUpgrade element.
对于最新版本的WiX,您可以删除很多此类代码,并用较新的MajorUpgrade元素替换。 It's a higher level abstraction that simplifies much of this authoring.
这是一个较高级别的抽象,可以简化大部分编写工作。
In order to have a successful MajorUpgrade several things have to happen: 为了成功进行MajorUpgrade,必须完成几件事:
1) Old and New MSI have to have the same UpgradeCode GUID. 1)新旧MSI必须具有相同的UpgradeCode GUID。 (Although it's technically possible for an MSI to remove unrelated Products by using additional UpgradeCode properties we'll ignore this for the purpose of this question.)
(尽管从技术上来说,MSI可以通过使用其他UpgradeCode属性来删除不相关的产品,但出于这个问题的目的,我们将忽略它。)
2) Old and New MSI must have unique ProductCode GUIDs. 2)新旧MSI必须具有唯一的ProductCode GUID。
3) New MSI must have a higher version ProductVersion property. 3)新的MSI必须具有更高版本的ProductVersion属性。 Please note that only the first 3 numbers are evaluated.
请注意,仅对前三个数字进行评估。 ( 1.2.3 -> 1.2.4 works 1.2.3.4 -> 1.2.3.5 does not )
(1.2.3-> 1.2.4有效1.2.3.4-> 1.2.3.5无效)
4) Old MSI and New MSI must be installed in the same context ( Per User->Per User or Per Machine -> Per Machine ) 4)旧MSI和新MSI必须在相同的上下文中安装(每个用户->每个用户或每台计算机->每台计算机)
5) Upgrade Table must be authored correctly. 5)升级表必须正确编写。 Use the MajorUpgrade element to assist in this.
使用MajorUpgrade元素可以帮助完成此任务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.