英文:
Wix V4 - CustomAction Condition only when updating
问题
问题细节:
我有一个在卸载时执行的操作,但在将产品更新到新版本时不执行。
我已经这样定义了UpgradeVersion:
Minimum="1.0.0" IncludeMinimum="yes"
Maximum="$(var.Version)" IncludeMaximum="no"/>
这是自定义操作及其条件:
<Custom Action="DOSTUFF" Before="RemoveFiles" Condition='(REMOVE="ALL") And (NOT PREVIOUSFOUND)'/>
尽管如此,当使用更高版本的.msi运行时,该操作仍然触发(例如:1.0.0 -> 1.0.1)。
我还尝试过像这样定义PREVIOUSFOUND
属性:<Property Id="PREVIOUSFOUND" Secure="yes"></Property>
,但无济于事。
我的期望:
我期望该操作仅在从控制面板“应用和功能”卸载时运行,而在将程序更新到更高版本时不运行。
英文:
Details of the problem:
I have an action that has to be executed when unistalling but not when updating the product to a new version.
I have defined the UpgradeVersion like this:
<UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND"
Minimum="1.0.0" IncludeMinimum="yes"
Maximum="$(var.Version)" IncludeMaximum="no"/>
and this is the Custom action and its Condition:
<Custom Action="DOSTUFF" Before="RemoveFiles" Condition='(REMOVE="ALL") And (NOT PREVIOUSFOUND)'/>
Despite this, the action still fires when running the .msi with a higher version (e.g.: 1.0.0 -> 1.0.1).
I've also tried defining the PREVIOUSFOUND
property like this: <Property Id="PREVIOUSFOUND" Secure="yes"></Property>
to no avail.
What I was expecting:
I expected the action to run only when uninstalling from the Control Panel Apps & Features and not when updating the program to a higher version.
答案1
得分: 2
根据Stein的评论,我在此帖子中找到了解决方案。
所以我将我的条件更改为<Custom Action="DOSTUFF" Before="RemoveFiles" Condition='(REMOVE="ALL") And (NOT UPGRADINGPRODUCTCODE)'/>
,现在CustomAction被正确触发。
英文:
As per Stein's comment, I found a solution in this post.
So I changed my condition to <Custom Action="DOSTUFF" Before="RemoveFiles" Condition='(REMOVE="ALL") And (NOT UPGRADINGPRODUCTCODE)'/>
and now the CustomAction is triggered correctly.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论