WIX - 安装时的自定义操作,而不是卸载或升级时的自定义操作 [英] WIX - Custom actions on Install but not on Uninstall or Upgrade

查看:32
本文介绍了WIX - 安装时的自定义操作,而不是卸载或升级时的自定义操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 wix 安装程序,我们在其中运行了多个自定义操作,例如注册等.但是我们只希望这些操作在安装时运行,而不是在升级或卸载时运行.

I have a wix installer where we have several Custom Actions running, like the registration etc. However we only want these to run on the Install, not on the upgrade or the uninstall.

我已经尝试将其设置为未安装并重新安装",但这也不起作用.

I've tried setting it to NOT Installed AND REINSTALL but that isn't working either.

当只想在安装而不是升级或卸载时通过自定义操作运行某些应用程序时,有谁知道正确的属性是什么?

Does anyone know what the correct property is when wanting to run certain apps via custom action only on Install and not on Upgrade or uninstall?

 <InstallExecuteSequence>
     <Custom Action="PosConfig.CustomAction" Before="StartServices"><![CDATA[NOT Installed AND NOT UPGRADINGPRODUCTCODE AND UILevel>3]]></Custom>
     <Custom Action="Register.CustomAction" After="PosConfig.CustomAction">NOT Installed AND NOT UPGRADINGPRODUCTCODE </Custom>
     <Custom Action="OPOSSelectorFirst.CustomAction" After="Register.CustomAction"><![CDATA[NOT Installed AND NOT UPGRADINGPRODUCTCODE AND &ProductFeature=3 AND Not OPOSDLLINSTALLED]]></Custom>
     <Custom Action="OPOSSelectorUpdate.CustomAction" After="OPOSSelectorFirst.CustomAction"><![CDATA[NOT Installed AND NOT UPGRADINGPRODUCTCODE AND &ProductFeature=3 AND Not OPOSDLLINSTALLED]]></Custom>
  </InstallExecuteSequence>

添加了我的自定义操作序列.

Added my Custom Action Sequence.

推荐答案

NOT Installed AND REINSTALL 永远不会同时为真.这意味着该应用程序尚未安装,但当前正在重新安装.这将如何运作?

NOT Installed AND REINSTALL can never be true at the same time. That would mean the application is not installed but is currently being re-installed. How would that work?

改为使用此条件来安排您的自定义操作:

Schedule your custom action by using this condition instead:

未安装且未升级PRODUCTCODE

这可以防止它在重大升级时被触发.

This prevents it from being triggered on major upgrades.

这篇关于WIX - 安装时的自定义操作,而不是卸载或升级时的自定义操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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