简体   繁体   English

使用wix安装较新版本的msi时从程序和功能中删除程序

[英]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.

相关问题 仅为当前用户安装MSI时,不会卸载旧版本的应用程序(两次出现在“添加/删除程序”中) - When installing MSI for current user only, the old version of application is not uninstalled (appears in Add/Remove programs twice) WIX:InstallValidate在安装MSI时添加REMOVE属性吗? - WIX: InstallValidate adding REMOVE property when installing MSI? wix:TEMP目录MSI的“添加/删除程序”中的MSI修复提示 - wix: MSI repair from Add/Remove Programs prompts for TEMP directory MSI 更新应用程序时,Wix MSI安装程序未从“添加/删除应用程序”中删除以前的版本 - Wix MSI installer is not removing previous version from “Add/Remove Applications” when updating the application 使用WiX时,如何从MSI中删除“将被安装以从网络上运行”安装选项? - How to remove “Will be installed to run from network” installation options from MSI when using WiX? 如何在Wix安装期间从“程序和功能”中删除条目? - How can I remove an entry from Programs & Features during a Wix install? Wix:从另一个MSI安装和配置MSI软件包 - Wix: installing and configuring MSI packages from another MSI Wix自定义操作不会使用“添加/删除”程序执行,但会执行运行中的MSI并选择“删除” - Wix custom action does not execute using Add/Remove program but does execute running MSI and selecting Remove 无法从WiX创建的MSI卸载程序 - Unable to uninstall program from WiX created MSI WiX捆绑包:安装捆绑包2.0.0时,不会从程序和功能中删除1.0.0的修补程序 - WiX Bundle: Patches for 1.0.0 are not removed from Programs & Features when bundle 2.0.0 is installed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM