Question

I'm working on a WiX installer using the Visual Studio 'Votive' integration.

I'm authoring a simple custom table using <CustomTable> and I want to place it in a separate file within a <Fragment>.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
      <CustomTable Id="CustomActionData">
        <Column Id="Id" Category="Identifier" PrimaryKey="yes" Type="int" Width="4" />
        <Column Id="AssemblyFile" Category="Text" Type="string" PrimaryKey="no" />
        <Column Id="TypeName" Category="Text" Type="string" PrimaryKey="no" />
        <Row>
          <Data Column="Id">1</Data>
          <Data Column="AssemblyFile">MyAssembly.dll</Data>
          <Data Column="TypeName">MyAssembly.TypeName</Data>
        </Row>
      </CustomTable>
    </Fragment>
</Wix>

The trouble is, WiX/Votive doesn't include the fragment because nothing references it. There is no such thing as a <CustomTableRef>. <Fragment> is, however, a valid parent of <CustomTable>, so there must be a way of making WiX include it.

Any suggestions? How do I reference a custom table within a fragment?

Was it helpful?

Solution

Ideally there'd be a CustomTableRef but that doesn't exist. (Feel free to file a suggestion.) So you need another Element/ElementRef pair. Try Property/PropertyRef instead.

The way this works with WiX custom actions is that a compiler extension writes the custom table rows directly so there's no authoring that needs to be linked in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top