I have a scenario, based on the user selection few dlls are copied to a specific folder while installation. I'm trying to generate an output using Harvest Tool (Heat). Every time heat is run it regenerates the output file and any changes are lost (the copyfile part).
How to achieve this? Any help in the right direction is much appreciated.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<Directory Id="dir123" Name="Test">
<Component Id="cmp123" Guid="*">
<File Id="fil123" KeyPath="yes" Source="SOURCEPATH" />
<CopyFile Id="fil456" DestinationProperty="DESTINATIONPATH"/>
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="Test">
<ComponentRef Id="cmp123" />
</Fragment>
Try heat's
-tparameter. In your specific case, your XSLT could construct a<CopyFile>and insert it either next to the File or nest it under it (specifically supported). Note that you'll likely also need a corresponding<RemoveFile>to guarantee a clean uninstall. Also, CopyFile runs unconditionally so you won't be able to make it depend on user selection easily, and if the copy destination is writable from your application, it may be easier to copy the files on its first run instead of hacking it into the installer.