仅在安装时检查 wix Bootstrapper RegistrySearch bal:Condition

Wah*_*ari 5 wix wix3 bootstrapper

我正在使用 wix 为 Outlook 插件创建引导程序。我只需要在安装时检查 Outlook 注册表搜索。我的以下检查在安装时运行良好。但是在我的插件安装之后,当有人卸载 Outlook 然后尝试卸载我的插件时,此注册表搜索检查也会在卸载时运行,这会导致卸载程序被阻止。我必须仅在安装时运行这些 Outlook 注册表搜索检查。我的支票如下:

<util:RegistrySearch  Variable="Outlook2013Present" Root="HKLM" Key="SOFTWARE\Microsoft\Office\15.0\Outlook\InstallRoot"   Value="Path" />
<util:RegistrySearch  Variable="Outlook2013Present64" Root="HKLM" Key="SOFTWARE\Microsoft\Office\15.0\Outlook\InstallRoot"   Value="Path" Win64="yes" />

<bal:Condition Message="This setup requires Outlook 2010 or 2013. Please install office and then run installer again ">
  Outlook2010Present OR Outlook2010Present64 OR Outlook2013Present OR Outlook2013Present64
</bal:Condition>
Run Code Online (Sandbox Code Playgroud)

URB*_*URB 4

根据文档Wix Toolset Documentation WixBundleAction 是 Wix Bootstrapper 中可用的 BOOTSTRAPPER_ACTION。

正如这里的回答:Wix Installer Forum我认为你可以尝试这样的事情:

<bal:Condition Message="This setup requires Outlook 2010 or 2013. Please install office and then run installer again ">

      (Outlook2010Present OR Outlook2010Present64 OR Outlook2013Present OR Outlook2013Present64 ) OR WixBundleAction = 3

</bal:Condition>
Run Code Online (Sandbox Code Playgroud)

通过使用WixBundleAction = 3内部条件子句,该条件仅适用于安装,并且在卸载期间将被忽略。

希望这可以帮助。