Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix Heat output not referencing directory like I want

So here's the basic setup. I have an existing WIX project that builds a bunch of individual fragments in to a larger MSI. I'm trying to change the project around to allow you to select individual pieces to install. The program I've run in to is that when I run heat on the smaller directories to create the individual components, the Source path isn't correct. I'll give an example as hopefully that will make more sense.

So I have basic folder structure like this:

C:\ProjDir\Foo\Bar1
C:\ProjDir\Foo\Bar2

I used to a command to simply harvest C:\Foo (Heat.exe dir Foo -dr FOO_DIR_REF -out File.wxs), and now I've changed it to to harvest each individual Bar folder (Heat.exe dir Foo\Bar1 -dr BAR1_DIR_REF -out File1.wxs) and (Heat.exe dir Foo\Bar2 -dr BAR2_DIR_REF -out File2.wxs). The problem I'm having is that the output of the harvest looks like this:

<Component Id="cmpblablabla" Guid="{stuff-here}">
    <File Id="filblabla" KeyPath="yes" Source="SourceDir\Bar1\file.here" />
</Component>

And when trying to build the msi it complains because it can't find SourceDir\Bar1. Basically what I need is a way to make it look something like this:

<Component Id="cmpblablabla" Guid="{stuff-here}">
    <File Id="filblabla" KeyPath="yes" Source="SourceDir\Foo\Bar1\file.here" />
</Component>

This seems like a very simple problem, that I'm sure is easily done, but all the searching I've done has not come up with anything useful.

like image 408
Zipper Avatar asked Aug 02 '11 16:08

Zipper


2 Answers

Note that light will search additional SourceDir's for your file if you add them to the search path with -b

e.g.

light.exe -b Foo ...
like image 134
saschabeaumont Avatar answered Sep 20 '22 04:09

saschabeaumont


It should be

<Component Id="cmpblablabla" Guid="{stuff-here}">
    <File Id="filblabla" KeyPath="yes" Source="$(var.ProjectName.TargetPath)\Bar1\file.here" />
</Component>

Different properties available are

  • $(var.ProjectName.TargetPath)
  • $(var.ProjectName.ProjectDir)
like image 36
Sunil Agarwal Avatar answered Sep 20 '22 04:09

Sunil Agarwal