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

Lewis Henderson henderso at opentext.com
Fri Feb 3 07:25:53 PST 2017


Thanks Fyodor,

But the AssignToProperty is a YesNoType parameter according to the spec, and causes only the path itself to be assigned to a property instead of the complete filespec.

				Lewis

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Fyodor Koryazhkin
Sent: Friday, February 3, 2017 10:13 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] How to do a conditional FileSearch?

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 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_
> &d=DwICAg&c=ZgVRmm3mf2P1-XDAyDsu4A&r=yAhF6NGJ7EPmZkvswZOswwnYxaueKkO53
> V282tTn1P4&m=UrJiWIHp1gTBpXnCfCi-avw83fVvJsG4dRRRtEb0ZIw&s=KO8-38c077L
> iQ7Ojb3KbmGI2UyrVXIFLFnByrL2EhL8&e=
>



--
Regards,
Fyodor Koryazhkin..

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_&d=DwICAg&c=ZgVRmm3mf2P1-XDAyDsu4A&r=yAhF6NGJ7EPmZkvswZOswwnYxaueKkO53V282tTn1P4&m=UrJiWIHp1gTBpXnCfCi-avw83fVvJsG4dRRRtEb0ZIw&s=KO8-38c077LiQ7Ojb3KbmGI2UyrVXIFLFnByrL2EhL8&e= 


More information about the wix-users mailing list