General command to create fragment structure for source directory as below:
"heat.exe directory" dir "source directory" -cg ALLCOMP -dr INSTALLFOLDER -gg -g1 -sf -srd -var "var.SDir" -out "export directory"
Notes:
(1) "heat.exe directory" is by client.
(2) "source directory" is by client.
(3) "ALLCOMP" is ComponentGroup ID which is also referenced in Product.wxs <ComponentGroupRef Id="..." />.
(4) "INSTALLFOLDER" is folder ID which is defined in Product.wxs <Directory Id="..." Name="..."/>.
(5) "var.SDir" is variable for source directory defined in Defineds.wxi.
(6) "export directory" is exported full file name.
Product.wxs:
<Fragment Id="fmDefineTree">
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id='INSTALLDIR' Name='!(loc.ProductName)'>
<Directory Id="..." Name="..."/>
</Directory>
</Directory>
</Fragment>
<Fragment Id="fmFG">
<FeatureGroup Id="MMSWixFeatures" >
<Feature Id="ProductFeature" Title="!(loc.ProductName)" Level="1">
<ComponentGroupRef Id="..." />
</Feature>
</FeatureGroup>
</Fragment>
Defineds.wxi:
<Include>
<!--define variable for source directory-->
<?define ContentDir="..\..\Content" ?>
</Include>