开发者

How do I create an empty custom table in Wix?

How do I get Wix to include a CustomTable with no rows in the final MSI? If I simply define the table like this

<CustomTable Id="MyTable">
  <Column I开发者_高级运维d="Id" Type="string" Category="Identifier" PrimaryKey="yes"/>
  <Column Id="Root" Type="string"/>
  <Column Id="Key" Type="string"/>
  <Column Id="Name" Type="string"/>
</CustomTable>

Wix omits it from the final output.

My DTF CustomAction is expecting it to be there, so that it can add rows to it during execution.

Any ideas?


Thanks to a comment in this blog post (which, by the way, has a very useful example of a DTF Custom Action) I found the Wix EnsureTable element, which makes sure a table appears in the output, even if it is empty.

So to make my example work, I need to do this:

<CustomTable Id="MyTable">
  <Column Id="Id" Type="string" Category="Identifier" PrimaryKey="yes"/>
  <Column Id="Root" Type="string"/>
  <Column Id="Key" Type="string"/>
  <Column Id="Name" Type="string"/>
</CustomTable>

<EnsureTable Id="MyTable"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜