如何使用 MajorUpgrade 和 RemoveFeatures 仅删除特定功能并仍然卸载产品的先前版本 [英] How to use MajorUpgrade and RemoveFeatures to remove only specific features and still un-install the previous version of the product

查看:17
本文介绍了如何使用 MajorUpgrade 和 RemoveFeatures 仅删除特定功能并仍然卸载产品的先前版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从与 VS 2010 一起打包的 Microsoft 安装程序切换到 Wix 3.6.我正在尝试使用 标签向我们的用户发布无缝升级,但是我有一个我不想在执行这次重大升级时卸载的功能.

I swapped to Wix 3.6 from the Microsoft Installer that was packaged with VS 2010. I am trying to release a seamless upgrade to our users by using the <MajorUpgrade/> Tag, however I have one feature that I do not want to be un-installed while performing this major upgrade.

如下所示,我有 RemoveFeatures="[ProductFeature]" 这将导致只有 ProductFeature 被删除而 DataFeature 将保留,但这会导致条目不会从程序"中删除和功能"列表在 Windows 中,当未指定此参数时.如何在不卸载特定功能的情况下正确升级?

As seen below I have RemoveFeatures="[ProductFeature]" which will result in only the ProductFeature being removed and the DataFeature will remain, but this results in the entry not being removed from the "Programs and Features" list in Windows as it is when this parameter is not specified. How can I upgrade properly without un-installing specific features?

<Product Id="*" 
       Name="$(var.MyProject.ProjectName)" 
       Language="1033" 
       Version="2.6.0.0" 
       Manufacturer="Awesome Software (Pty) Ltd"          
       UpgradeCode="D7B99D7F-340D-449D-9C18-5D4A4A9B13D5">       
<Package InstallerVersion="405"
         Compressed="yes"              
         Description="Installs $(var.MyProject.ProjectName)"             
     Keywords="Awesome"
     InstallScope="perMachine"/>

<WixVariable Id="WixUILicenseRtf" Value="$(var.SolutionDir)\awesome.EULA\awesome CE Eula.rtf" />
<MediaTemplate EmbedCab="yes"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." 
RemoveFeatures="[ProductFeature]" Schedule="afterInstallInitialize"/>

<Feature Id="ProductFeature" Title="Setup $(var.MyProject.ProjectName)" Level="1">      
  <ComponentGroupRef Id="FilesFragment" />
  <ComponentRef Id="C__5B1F76E18B8F479DAAA1B8C14E4B0638"/>
  <ComponentRef Id="C__5B1F76E18B8F479DAAA1B8C14E4B0639"/>
  <ComponentRef Id="cmpA0688C6933D519CB5D1B6D48D50F1E21"/>
</Feature>

<Feature Id="DataFeature" Title="Data $(var.MyProject.ProjectName)" Level="1" >
  <ComponentGroupRef Id="DataFragment" />
</Feature>

<!-- Wix UI Prompts -->
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER"/>            
<UIRef Id="WixUI_InstallDir"/>

<Binary Id="myCustomActionsDLL" SourceFile="$(var.CustomActions.TargetDir)MaxCut.CustomActions.CA.dll"/>

<InstallExecuteSequence>
  <Custom Action="CA_myCustomAction" Before="InstallInitialize"/>
</InstallExecuteSequence>

推荐答案

如果您不卸载所有功能,Windows Installer 会将旧产品保留在机器上.当卸载过程中 Feature 下的 Condition 评估为 false 时,通常会发生这种情况.你已经找到了另一种方式来达到这个场景.这几乎每次发生时都会让人们感到困惑.

If you don't uninstall all the features, the Windows Installer will keep the old product on the machine. This often happens when a Condition under a Feature evaluates to false during uninstall. You've found another way to hit that scenario. This confuses people pretty much every time it happens.

简短的回答:你不能用功能做你想做的事.

Short answer: you can't do what you are trying to do with features.

这篇关于如何使用 MajorUpgrade 和 RemoveFeatures 仅删除特定功能并仍然卸载产品的先前版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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