Wix - Copy the entire directory and all its contents

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

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

It does not pick files or subdirectories from a preprocessor variable.

Are there any alternative ways to achieve this?

+4
source share
2 answers

Not unless you are using a custom action. WiX loves to have each file tracked separately. You can use heat to create a directory listing for you.

+3
source

Use heat.exe or HeatTask in MSBuild. This is the only way to do something today.

+3
source

All Articles