A few options:
Create a
binary .wixlib
- use the-bf
switch tolit.exe
to embed the files into the .wixlib. That way the .wixlib is completely self-contained, although it will be bigger.Use
bind paths
- bind paths are like search paths but to find the files that need to end up in the package. If you make theFile/@Source
relative (do not start withX:\
or just\
) then the unnamed bind paths will be searched. You specify bind paths tolight.exe
using the-bp
command-line switch. Alternatively you can use named bind paths, they look like this:<File Source='!(bindpath.Name)\FarPoint.CalcEngine.dll' />
Again, the
-bp
switch can create named bind paths.Use
bind variable
- instead of using a preprocessor variable (resolved before "compile"), use a variable that is resolved at "bind time". You can reference a bind variable like:!(wix.Var)
. That can be set on the command-line tolight.exe
or you can set it in code using theWixVariable
element.
I use option #1 to distribute .wixlibs to other people (to be self-contained), and option #2 if it's just my stuff (binary .wixlibs will slow the build a bit).