[wix-users] How to do a conditional FileSearch?

Lewis Henderson henderso at opentext.com
Fri Feb 3 06:15:08 PST 2017


Hi Everyone,

I posted earlier under a different (more obscure) subject and got no replies, so here's the crux of the matter.  I have a WiX installer which does a FileSearch based on a path from a RegistrySearch.  This is all fine and dandy as long as the RegistrySearch succeeds, but things go awry if it fails.  Is there any way to conditionally skip  the FileSearch if the RegistrySearch comes up empty?  Here's the relevant code:


    <Property Id="JDK_VERSION" Secure="yes">

      <RegistrySearch Id="jdk_ver" Root="HKLM"

                      Key="Software\JavaSoft\Java Development Kit"

                      Name="CurrentVersion" Type="raw" />

    </Property>

    <Property Id="JDK_HOME" Secure="yes">

      <RegistrySearch Id="jdk_home" Root="HKLM"

                      Key="Software\JavaSoft\Java Development Kit\[JDK_VERSION]"

                      Name="JavaHome" Type="raw" />

    </Property>

    <Property Id="JDK_JVM" Secure="yes">

      <DirectorySearch Id="jdk_jvm" Path="[JDK_HOME]" Depth="3">

        <FileSearch Name="jvm.dll" />

      </DirectorySearch>

    </Property>

Thanks for any help you can provide.

                                                                Lewis



More information about the wix-users mailing list