You can certainly achieve the goal that you defined.   What I do is a little
different and is based on the structure that I observed in the Wix src\Setup
(the source for the setup which deploys the tools).

There you will see a CommonLib wixlib project.  I define my folder tree (for
many different setup projects) in that wixlib, putting each folder
definition in a separate fragment.  In a given MSI project which consumes
this wixlib only those fragments which are referenced in the project are
pulled into the MSI.

So in the wixlib you might have
        <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir" />
        </Fragment>

  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Directory Id="ProgramFilesFolder" >
        <Directory Id="INSTALLFOLDER" Name="Company"  />
      </Directory>
    </DirectoryRef>
  </Fragment>

  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Directory Id="ProgramFiles64Folder" >
        <Directory Id="INSTALLFOLDER64" Name="Company"  />
      </Directory>
    </DirectoryRef>
  </Fragment>

  
  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Directory Id="ProgramMenuFolder" Name="ProgMenu">
        <Directory Id="ShortcutDir" Name="Company" />
      </Directory>
    </DirectoryRef>
  </Fragment>

  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Directory Id="DesktopFolder" Name="Desktop" />
    </DirectoryRef>
  </Fragment>

  
  <Fragment>
    <DirectoryRef Id="INSTALLFOLDER">
      <Directory Id="DSDir" Name ="app1"/>
    </DirectoryRef>
  </Fragment>

  
  <Fragment>
    <DirectoryRef Id="INSTALLFOLDER">
      <Directory Id="eRSDir" Name ="app2"/>
    </DirectoryRef>
  </Fragment>

I do not specify any source file information in the wixlib.

In the MSI you can either put the Feature tree and the Components together
or separate the component groups into separate Fragments, which I prefer.

In the Product element have something like

    <Feature Id="App1" Title="$(var.AppName)" Level="1"
InstallDefault="local" TypicalDefault="advertise">
      ....product registration keys etc...
      <ComponentGroupRef Id="somefiles" />
      <ComponentGroupRef Id="some_other_files" />
    </Feature>

And then in separate Fragments you can define ComponentGroups.  When you
specify a DirectoryId (defined in the fragment, in my case in the wixlib) it
will pull that fragment into the msi.  The DirectoryID can be set on the
ComponentGroup, Component, or File elements.  So if within a ComponentGroup
different Components can use a different DirectoryId, which I think
overrides the DirectoryId of a parent element (but I have not don that). 





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Using-Fragments-and-Directory-Structure-tp7593019p7593023.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to