Yes a Property element can be under a Fragment or under a Product (or several
other possibilities).  Look at the schema in the chm.

If you put it in a Fragment (whether in the same wxs as your Product or a
different wxs) your Product, generally speaking, needs to have some
'reference' to something in the Fragment, and then everything in the
Fragment is pulled into the compilation.  So when I define a property in a
fragment like this:

in my commonProperties.wxs file I have:
  <Fragment>
    <Property Id='SOMEPROPERTY' Secure="yes" Admin="yes"/>
    <Property Id="PRE.SOMEPROPERTY">
      <RegistrySearch Id='FindSOMEPROPERTY' Root='HKLM'
Key='$(var.PropertiesRegKey)' Name='SOMEPROPERTY' Type='raw'/>
    </Property>
    <SetProperty Id='SOMEPROPERTY' Value='[PRE.SOMEPROPERTY]'
After='AppSearch'>NOT (SOMEPROPERTY)</SetProperty>
  </Fragment>
 
in the wxs which has my Product element add:
    <PropertyRef Id="SOMEPROPERTY"/>

   <Feature .....>
       <CompoentGroupRef Id="project_RememberProperties"/>
   </Feature>

Everything in the above Fragment is now part of this project.  My
commonProperties.wxs file may have other Fragments, but they are not used in
the project unless I add a reference.

You can read more here, and notice that the above is missing the code that
sets the registry key (which is also defined in a wxi file).
http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern
http://www.nichesoftware.co.nz/node/633

I put that code in another wxs and use a ComponentGroupRef (or a
ComponentRef) to pull that in the Product element.
  <Fragment>
    <ComponentGroup Id="project_RememberProperties" 
Directory="$(var.PropertiesDir)">

      <Component Id="regSOMEPROPERTY" Guid="guid">
        <RegistryValue Root="HKMU" Key="$(var.PropertiesRegKey)"
Name="SOMEPROPERTY Value="[SOMEPROPERTY]" Type="string" KeyPath="yes" />
      </Component>

...more components

    </ComponentGroup>
  </Fragment>





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Referring-to-variables-in-2nd-WXI-from-1st-tp7593502p7593513.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to