[wix-users] SetProperty and PropertyRef within Fragments...

Rob Mensching rob at firegiant.com
Tue Jul 19 12:54:56 PDT 2016


SetProperty is syntactic sugar for a Type51 CustomAction. So a Property doesn't exist, but a CustomAction does, usually the "SetProperty/@Id" prefixed with "Set".

However, you only need one reference into a Fragment for the rest to be referenced. So a reference to JRE_HOME will bring all that stuff in.

_____________________________________________________________
 Short replies here. Complete answers over there: http://www.firegiant.com/

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Lewis Henderson
Sent: Tuesday, July 19, 2016 12:18 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: [wix-users] SetProperty and PropertyRef within Fragments...

Hello Folks,

I've been working with Wix for a while now, but I have some "bad habits", such as using Wix includes rather than Fragments.  I'm working to correct this, but I've run into an issue.  I have one Fragment that defines some properties using SetProperty statements, but PropertyRef statements for those properties in other Fragments (and the main .wxs file) come up unresolved from light.  I can't just define a default property value (or can I), because the SetProperty statements are conditional.  This code snippet may help:

<Fragment>
  <Property Id="JRE_HOME" Secure="yes">
    <RegistrySearch ... />
  </Property>
  <Property Id="JRE_JVM" Secure="yes">
    <DirectorySearch Id="jre_jvm" Path="[JRE_HOME]\bin" Depth="1">
      <FileSearch Name="jvm.dll" />
    </DirectorySearch>
  </Property>
  <!-similar code for JDK_HOME and JDK_JVM -->
  <SetProperty Id="JAVA_HOME" Value="JRE_HOME"
   After="AppSearch">JRE_JVM</SetProperty>
  <SetProperty Id="JAVA_HOME" Value="JDK_HOME"
  After="AppSearch">NOT JAVA_HOME AND JDK_JVM</SetProperty>
  ...
</Fragment>

The conditions are actually a bit more complex as they're also enforcing a minimum version, but you get the idea.  The problem is that in other files, when I have <PropertyRef Id="JAVA_HOME">, I get "error LGHT0094 : Unresolved reference to symbol 'Property:JAVA_HOME'".

Does anyone have a good workaround for this issue?  Thanks for any assistance.

                                                                Lewis Henderson


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list