2010-04-14 246 views
3

如何讓Wix在最終的MSI中包含無行的CustomTable?如果我簡單地定義這樣的表格如何在Wix中創建一個空的自定義表格?

<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期待它在那裏,以便它可以在執行期間向它添加行。

任何想法?

回答

7

感謝這個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"/> 
相關問題