I've got a directory containing multiple files that I want to include in my msi package build by a Wix
project.
/database
/database/migration11.txt
/database/migration21.txt
/database/migration32.txt
Those files change often or there are new ones added, and I don't want to adapt my Wix
file with every new migration file.
Basically I want to say in my wxs
file to include all files in the directory database and upon installation put them in the directory [INSTALLLOCATION]/database
.
Any way to achieve this?
ADDED:
Just found this workaround: use HEAT but I'm curious if there is another, recommended way.
You can use task in your wixproj file:
<ItemGroup>
... Your wxs files ...
<HarvestDirectory Include="$(variable)\YourDirectory\">
<ComponentGroupName>CG_YOUR_GROUP</ComponentGroupName>
<DirectoryRefId>DIR_REFERENCE</DirectoryRefId>
<AutogenerateGuids>false</AutogenerateGuids>
<GenerateGuidsNow>false</GenerateGuidsNow>
<SuppressUniqueIds>true</SuppressUniqueIds>
<SuppressCom>true</SuppressCom>
<SuppressRegistry>true</SuppressRegistry>
<SuppressRootDirectory>true</SuppressRootDirectory>
<PreprocessorVariable>var.Property_Preprocessor</PreprocessorVariable>
</HarvestDirectory>
</ItemGroup>
This task calls Heat during the build. Hope this helps you.
If anyone still needs this, here is a sample of HarvestDirector with wixproj. Thanks to DavidEGrayson.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With