代码之家  ›  专栏  ›  技术社区  ›  Samuel Jack

如何在wix中创建空的自定义表?

  •  3
  • Samuel Jack  · 技术社区  · 15 年前

    如何让wix在最终msi中包含一个没有行的customtable?如果我只是这样定义表

    <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从最终输出中省略它。

    我的dtf customaction期望它在那里,以便它可以在执行期间向它添加行。

    有什么想法吗?

    1 回复  |  直到 15 年前
        1
  •  7
  •   Samuel Jack    15 年前

    多亏了这篇评论 blog post (顺便说一下,这里有一个非常有用的dtf自定义操作示例)我找到了wix EnsureTable 元素,确保表出现在输出中,即使它是空的。

    所以为了让我的例子起作用,我需要这样做:

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