1

Each one of my installers utilize certain temporary exes and dlls. In my WiX project I can put them in the Binary table. Since they're shared across all projects is it possible to put them into a wixlib? What would the syntax be.

I'm doing something similar with properties using the PropertyRef attribute. There is no corresponding BinaryRef attribute to do the same with the Binary table.

Doc
  • 698
  • 3
  • 16
  • 1
    For elements that don't have a corresponding *Ref element, you can use the following workaround: Create an empty `ComponentGroup` element (which is valid WiX code) in the fragment and `ComponentGroupRef` it where you want to reference the fragment. This pulls in the whole content of the `Fragment`, not just the `ComponentGroup`. – zett42 Jul 03 '18 at 16:21
  • That worked. Apparently I've been misunderstanding what the ComponentGroup element was for :(. Thanks Zett42 – Doc Jul 04 '18 at 23:24

1 Answers1

1

There is no corresponding BinaryRef attribute to do the same with the Binary table.

For elements that don't have a corresponding *Ref element, you can use the following workaround:

  • Create an empty ComponentGroup element (which is valid WiX code) in the fragment.
  • Insert a ComponentGroupRef element where you want to reference the Fragment. This pulls in the whole content of the Fragment, not just the ComponentGroup.

Example:

<Fragment>
    <ComponentGroup Id="MyBinaries"/>
    <Binary Id="Binary1" SourceFile="Files\Binary1.xyz"/>
    <Binary Id="Binary2" SourceFile="Files\Binary2.xyz"/>
</Fragment>

To reference MyBinaries from another .wxs file:

<Fragment>
    <ComponentGroup Id="SomeComponents">
        <ComponentGroupRef Id="MyBinaries"/>
    </ComponentGroup>
</Fragment>
zett42
  • 25,437
  • 3
  • 35
  • 72