I am creating a Windows Installer MSI using WIX. I want to separate files into different fragments, to have small chunks of code in each wxs file.
Currently I have below files: - Product.wxs which contains Product, Package, MediaTemplate and Feature elements. - Directories.wxs which contains folders structures and components to give permissions to user and remove folders on uninstall.
I want to take all my features out of Product.wxs too, and create it's own file, called Features.wxs.
Inside Directories.wxs, I have below line of code:
<Component Id="Component1" Guid="PUT_GUID_HERE" Directory="Subfolder">
<CreateFolder>
<util:PermissionEx GenericAll="yes" ChangePermission="yes" Delete="yes" DeleteChild="yes" User="Users"/>
</CreateFolder>
</Component>
With having above code, since I am referencing this Component in a Feature element, I am certain that my Product.wxs and Directories are linked.
But when I create a Feature.wxs file and move below lines of code to it:
<Feature Id="CreateDirectoriesFeature" Title="Feature1" Level="1">
<ComponentRef Id="Component1"/>
</Feature>
I don't know how/where to reference this fragment/features in my Product.wxs.