Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a folder to installer in wix not files?

Tags:

wix

wix3.5

wix3

My installer has to copy files into installdir... My application has around 2000 files and it is not possible for me to write the script to add each and every file to the installer. Is there any option in wix so that I can add all the files or the entire folder consisting the files at once? I am new to wix and i didnt find any option in any tutorial for this... Please do assist me and thanks in advance.....

like image 605
Prakash Avatar asked Jun 20 '12 13:06

Prakash


People also ask

How does WiX Installer work?

The WiX tools follow the traditional compile and link model used to create executables from source code. At build time, the WiX source files are validated against the core WiX schema, then processed by a preprocessor, compiler, and linker to create the final result.


1 Answers

Heat is the WiX harvest tool. You can run it on a directory to generate the necessary WiX source code.

EDIT: If you want to run heat before your VS project builds, add it to your project prebuild events as seen in the screenshot below (this is how I have my project setup to dynamically generate WiX source for our ever changing help content): VS Build Events

Note the -var wix.HelpSource switch that I have. The WiX source files generated by heat will set the location of the source files to that variable instead of hard-coding it. So the generated source will have components that look something like this:

<Component Id="Welcome.htm" Directory="Content" Guid="INSERT-GUID-HERE">
  <File Id="Welcome.htm" KeyPath="yes" Source="!(wix.HelpSource)\Content\Welcome.htm" />
</Component>

And in my particular case, I define that variable on the Tool Settings screen of my WiX VS project to the relative directory ..\..\Help\Output as seen below: enter image description here

NOTE: Harvesting files in this manner will cause the GUIDs of the components harvested to change every time you build. If you don't want your GUIDs to change, you may have to write some wrapper that calls heat to harvest the files, then updates your original WiX source, leaving all the GUIDs alone.

like image 187
BryanJ Avatar answered Oct 17 '22 10:10

BryanJ