4

My wix installer needs the contents of a directory to be copied to a destination folder. I understand that the Directory element has a FileSource attrib. I tried something like this:

<DirectoryRef Id="DIRECTORY" FileSource="{var.Dir}">
  <Component Id="Dir" Guid="*" >
    <CreateFolder/>
  </Component>
</DirectoryRef>

This is not picking up the files or sub-directories from the preprocessor variable.

Are there any alternate ways to achieve this?

Krishter
  • 489
  • 8
  • 24
  • I'm looking to automate HEAT into my build process. Could anyone point me to any relevant helpful resources? – Krishter Jul 25 '11 at 17:34

2 Answers2

3

No, not unless you use a custom action. WiX likes for every file to be tracked individually. You can use heat to generate the directory listing for you.

Bryan Boettcher
  • 4,412
  • 1
  • 28
  • 49
  • I did read about integrating HEAT into the pre-build event. I was wondering if completely automating would imply adding the HEAT generated file into the solution. – Krishter Jul 25 '11 at 15:04
  • Automatically generating every build means you're probably doing something wrong as far as MSI is concerned. The whole point is to track each file with repeatable and consistent identifiers, which you may lose by autogeneration. – Bryan Boettcher Aug 02 '11 at 16:24
3

Use heat.exe or HeatTask in MSBuild. That's the only way to do things today.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
  • I need to copy directories from my project folder to installation folder.Need help to do this using wix please refer this SO question http://stackoverflow.com/questions/27020130/how-to-copy-folder-files1-to-files5-during-the-installation-of-wix-installer and guide me – Royal Nov 19 '14 at 16:00