仅在卸载期间而不是重大升级期间运行Wix Custom操作 [英] Run Wix Custom action only during uninstall and not during Major upgrade

查看:117
本文介绍了仅在卸载期间而不是重大升级期间运行Wix Custom操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用在InstallInitialiseInstallFinalize标准动作之间安排的自定义动作来删除文件.

I am trying to delete a file using a custom action scheduled between InstallInitialise and InstallFinalize standard action.

MajorUpgrade element用于设计升级.

但是,我希望自定义操作仅在卸载期间运行,而不在主要升级(包括卸载和安装)期间运行.

However, I want the custom action to run only during uninstall and not during the Major upgrade(this includes uninstall and install).

我使用以下条件来执行CUstom动作:

I have used the following conditions to execute the CUstom action:

  1. (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
  2. REMOVE AND NOT WIX_UPGRADE_DETECTED
  1. (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
  2. REMOVE AND NOT WIX_UPGRADE_DETECTED

有没有一种方法可以使用Wix中的属性唯一地检测主要升级?

Is there a way to uniquely detect the Major Upgrade using properties in Wix?

推荐答案

菲尔已经回答了.我要发表几个小时前写的东西 在出发之前.您指定的条件对我来说看起来不错. 也许我会快速回顾一下可能导致的事情 混乱-例如什么自定义操作何时运行?

Phil has already answered. I'll just post what I wrote a few hours ago before heading out. The conditions you specify look pretty good to me. Maybe I'll do a quick review of things that are likely to cause confusion - such as what custom actions run when?


主要升级 :主要升级实际上是安装新应用程序版本并结合了旧版本的卸载-可能有不同的卸载计划(卸载旧版本和卸载版本).安装新的,或安装新的并卸载旧的).因此,在进行重大升级操作时, 1) 卸载序列仅针对旧设置运行,而 2) 新安装程序仅运行其安装顺序.这对于了解什么时候以及为什么运行自定义操作至关重要.


Major Upgrades: A major upgrade is really an install of a new application version combined with the uninstall of the old version - with different uninstall scheduling possible (uninstall old and install new, or install new and uninstall old). Hence, during a major upgrade operation, 1) the uninstall sequence runs only for the old setup, and 2) the new setup runs only its install sequence. This is of crucial importance to understand what custom actions runs when and why.

自定义操作和主要升级 :换句话说:此顺序可能会给自定义操作顺序带来很大的混乱,因为它看起来像是操作实际上是在旧安装程序的卸载顺序中运行的,它是从新安装程序运行的.如果您对序列草率工作比较草率,则通常的错误是在升级过程中看到同一操作多次运行-如果在即时模式下运行自定义操作,则每次设置可能运行两次(总计四次).

Custom Actions and Major Upgrades: To put it in other words: this sequencing can cause quite a bit of confusion for custom action sequencing, since it could appear that an action runs from the new setup, when it in fact runs in the old setup's uninstall sequence. If you are sloppy with sequencing, the typical error is seeing the same action run many times during the upgrade process - potentially twice from each setup (four times in total) - if you run the custom action in immediate mode.

不进行重大升级改造 :如Phil所述,您无法在新设置内添加将在旧设置的卸载序列中运行的自定义操作.该自定义操作必须是原始设置的一部分,或者必须通过较小的升级来添加(该升级将就地升级现有安装,而不是卸载并重新安装它).

No Retrofitting for Major Upgrades: As Phil explains, you can not add a custom action that will run during the old setup's uninstall sequence inside the new setup. That custom action would have had to be part of the original setup, or added via a minor upgrade (which upgrades the existing installation in-place, rather than uninstall and reinstall it).

重要 :

Important:

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