Frage

I created a WixLib project and solution that contains a fragment that points to a set of DLLS's I would like to include in multiple projects.

However when I reference this wixlib from other solutions the preprocessor value for the directory the dlls are in come with the wixlib. I would like to override this value or update it.

My Wixlib looks like this:

<Fragment>
   <ComponentGroup Id="CG.FarPointComponents">
      <Component Id="cmpBBC3777DD58F5E2AE4704D66EF87C105" Directory="INSTALLDIR"
                 Guid="6CB60019-D122-41F6-8009-C41B07BCE5C3">
         <File Id="filC126C8C2BFE502E045C17A812B8A907D" KeyPath="yes"
               Source="$(var.FarPointDir)\FarPoint.CalcEngine.dll" />
      </Component>
   </ComponentGroup>
</Fragment>

I want to specify another directory for the var.FarPointDir in the other solution what should I do? I am using wix 3.6

War es hilfreich?

Lösung

A few options:

  1. Create a binary .wixlib - use the -bf switch to lit.exe to embed the files into the .wixlib. That way the .wixlib is completely self-contained, although it will be bigger.

  2. 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 the File/@Source relative (do not start with X:\ or just \) then the unnamed bind paths will be searched. You specify bind paths to light.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.

  3. 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 to light.exe or you can set it in code using the WixVariable 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).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top