Announcement

Collapse
No announcement yet.

Ability to refresh directory tree automatically

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ability to refresh directory tree automatically

    Sorry if this is a FAQ, I tried to find this mentioned elsewhere, but couldn't (my google foo is weak I guess).

    I have a msifactory project with a nice big directory tree of files. Now sporadically the developers will add/remove files. Is there a way to have my automatic builds pick those up without me having to edit the project. Either a refresh or a "just include everything in this folder" would be great.

  • #2
    Just harvest the folder at build time instead of including the contents explicitly in the file list. Use the harvester (heat.exe) to create a WiX fragment for you, then include this fragment into your project at build time. In Setup Factory, you would use a folder reference. In Windows Installer (and MSI Factory), there is no such things so you use Heat.
    1. Use Heat to harvest the source folder and create WiX fragment.

      Example:
      Code:
      heat.exe dir [COLOR="#8b0000"]D:\Downloads[/COLOR] 
      	-sfrag -srd -ag -cg [COLOR="#8b0000"][COLOR="blue"]MySubFolder[/COLOR][/COLOR] -dr INSTALLDIR 
      	-out [COLOR="#006400"]directory[/COLOR].wxs -var var.[COLOR="#a0522d"]SubFolderPath[/COLOR]
      MySubFolder is the ComponentGroup name which will be associated with this sub folder.
      INSTALLDIR is the folder reference where these files should be deployed (in this sample, the target folder itself).
      If there are sub folders in the source, they will be created in the target folder.

      This task can be performed in a batch, in the "Before build" step.

    2. Include the WiX fragment in the MSI Factory project.

      Build Settings > Fragments > Add "directory.wxs" file. In the main WXS insertions, add
      Code:
      Insertion type:	"Last Child"
      Target:		"/Wix/Product/Feature"
      Text to insert:	"<ComponentGroupRef Id="[COLOR="blue"]MySubFolder[/COLOR]"/>"
    3. Add the variable definition to the compiler (candle.exe):

      -dSubFolderPath=D:\Downloads

    4. Build and test. You will set up this once, and afterwards just rebuild the project when the folders are updated with new content. The new WiX fragment will reflect the changes.


    Ulrich

    Comment


    • #3
      Awesome... thx for the quick response. I just found heat on google, so this saves me a lot of time :-).

      Comment

      Working...
      X