Wednesday, 15 August 2012

Using Wix's harvest tool Heat to generate list of files from websites and directories

A while ago I was asked to write an installer for a project I'm working on and I immediately thought of Wix.

There was one problem though, thus far I had only used Wix for simple projects with not that many files but not this time, there were multiple websites and multiple projects and I wasn't going to do ~ 30+ odd files by hand, which is where Heat came in.

In order to generate a wxs file containing all files in a website this is the command to use:
Heat website MyWebsite -gg -cg  MyWebsite -o MyWebsite.wxs
where website tells heat that its harvesting a website
MyWebsite is the name of the website in IIS
-gg means that guids will be generated now
-cg MyWebsite will generate a component group called MyWebsite
-o MyWebsite.wxs will output to MyWebsite.wxs

Note that in a default installation Heat can be found in this directory:

C:\Program Files\Windows Installer XML v3.5\bin\

In order to run the above command the website needs to exist, which normally means that it has been deployed from Visual Studio.

Heat is not limited to harvesting websites though, it can also harvest directories, like this:
Heat dir "C:\solutions\" -gg -cg solutions -out solutions.wxs
Hope this helps in making the Wix experience easier.

No comments:

Post a Comment