[wix-users] How to do a conditional FileSearch?
Fyodor Koryazhkin
fyodorkor at gmail.com
Fri Feb 3 07:13:15 PST 2017
Try to put DirectorySearch element under the RegistrySearch element:
<Property Id="JDK_HOME" Secure="yes">
<RegistrySearch Id="jdk_home" Root="HKLM"
Key="Software\JavaSoft\Java Development Kit\[JDK_VERSION]"
Name="JavaHome" Type="raw">
<DirectorySearch Id="jdk_jvm" Path="[JDK_HOME]" Depth="3"
AssignToProperty=JDK_JVM >
<FileSearch Name="jvm.dll" />
</DirectorySearch>
</RegistrySearch>
</Property>
On Fri, Feb 3, 2017 at 4:15 PM, Lewis Henderson <henderso at opentext.com>
wrote:
> 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
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
--
Regards,
Fyodor Koryazhkin..
More information about the wix-users
mailing list