How to create an empty user table in Wix?

How do I get Wix to enable CustomTable without strings in the final MSI? If I just define a table like 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>

Wix excludes it from the final output.

My DTF CustomAction expects it to be there so that it can add rows to it at runtime.

Any ideas?

+3
source share
1 answer

Thanks to the comment on this blog post (which, by the way, has a very useful DTF Custom Action example), I found the Wix EnsureTable element , which ensures that the table will be displayed even if it is empty.

, , :

<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"/>
+7

Source: https://habr.com/ru/post/1741133/


All Articles