[wix-users] SetProperty and PropertyRef within Fragments...
Lewis Henderson
henderso at opentext.com
Tue Jul 19 12:17:39 PDT 2016
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
More information about the wix-users
mailing list