title: WiX Bundle bal:condition - util:RegistrySearch variable always false
body: <p>I want my install to fail if a third-party software element is not installed. I added a <code>Fragment</code> with a <code>util:RegistrySearch</code> and a <code>bal:Condition</code> to the <code>Bundle</code>, but I can't get it to work. <code>ThirdPartyCOMLibraryInstalled</code> never evaluates to true. I've confirmed that the key exists, and the value I use for <code>Key</code> is correct - I copy/pasted the name from the selected key in regedit. There aren't any errors in the log.</p>
  
  <p>I'm building the installer with WiXTools 3.7 in Visual Studio 2012 on Windows&nbsp;7 64-bit and testing on both Windows&nbsp;XP SP3 and Windows&nbsp;7 64-bit.</p>
  
  <p>Searching online for other examples for <code>util:RegistrySearch</code> I ran across the following alternative forms for the condition test expression.</p>
  
  <ol>
  <li><code>ThirdPartyCOMLibraryInstalled = 0</code> - always False</li>
  <li><code>ThirdPartyCOMLibraryInstalled &lt;&gt; 1</code> - always True</li>
  </ol>
  
  <p>Here is the <code>Bundle</code> code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
       xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
       xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
       xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"&gt;
  
      &lt;Bundle Name="!(bind.packageName.MyApp)"
              Version="!(bind.packageVersion.MyApp)"
              Manufacturer="!(bind.packageManufacturer.MyApp)"
              UpgradeCode="a07ce1d5-a7ed-4d89-a7ee-fb13a5dd69ba"
              Copyright="Copyright (c) 2013 [Bundle/@Manufacturer]. All rights reserved."
              IconSourceFile="$(var.My_Application1.ProjectDir)MyCo.ico"&gt;
  
          &lt;bal:Condition Message="ThirdParty Application COM Library Required. Please (re)install ThirdParty Application and ensure 'Windows API' and '.NET Components' are installed."
          &gt;ThirdPartyCOMLibraryInstalled&lt;/bal:Condition&gt;
  
          &lt;Variable Name="InstallFolder"
                    Type="string"
                    Value="[ProgramFilesFolder]MyCo Systems\My_Application\"/&gt;
          &lt;BootstrapperApplicationRef
              Id="WixStandardBootstrapperApplication.HyperlinkLicense" &gt;
  
              &lt;bal:WixStandardBootstrapperApplication
                  ThemeFile="Resources\HyperlinkTheme.xml"
                  LaunchTarget="[InstallFolder]My_Application.exe"
                  LocalizationFile="Resources\HyperlinkTheme.wxl"
                  SuppressRepair="yes"
                  SuppressOptionsUI="yes"
                  LicenseUrl=""
                  LogoFile="Resources/MyCoLogoWt64.png"
  
              /&gt;
          &lt;/BootstrapperApplicationRef&gt;
          &lt;Chain&gt;
              &lt;PackageGroupRef Id="NetFx40Redist"/&gt;
              &lt;MsiPackage Id ="MyApp"
                          Vital="yes"
                          Name="My Application"
                          SourceFile="$(var.MyApp_Install.TargetDir)MyApp_Install.msi"&gt;
                  &lt;MsiProperty Name="INSTALLLOCATION"
                               Value="[InstallFolder]" /&gt;
              &lt;/MsiPackage&gt;
          &lt;/Chain&gt;
      &lt;/Bundle&gt;
  
      &lt;Fragment&gt;
        &lt;util:RegistrySearch
              Variable="ThirdPartyCOMLibraryInstalled"
              Result="exists"
              Root="HKLM"
              Key="SOFTWARE\Classes\ThirdPartyId.Server\CLSID"/&gt;
      &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>