编辑:我已经更新了下面的代码,现在它可以运行了,感谢Rob的回答.
我发现了几个页面,显示如何做到这一点(http://www.cmcrossroads.com/content/view/13160/120/,http://www.mail-archive.com/wix-users@ lists.sourceforge.net/msg05103.html)并查看了WAI的源代码(http://wai.codeplex.com/),但无论我尝试什么,我似乎都无法在我的安装程序中使用它.如果有人能发现我做错了什么,我会非常感激.我对话的WiX片段如下所示:
<UI>
<Dialog>
...snip...
<Control Id="WebsiteName" Type="ComboBox" ComboList="yes" Sorted="yes" Property="IIS_WEBSITENAME" X="20" Y="73" Width="150" Height="17"/>
...snip...
<!-- We want our custom action to fill in the WebsiteName ComboBox above
however, if no ComboBox entries exist at compile time then the
ComboBox table is not created in the MSI and we can't add to it in
the custom action. So we have this hidden dummy list box to force
the table to appear. --> …Run Code Online (Sandbox Code Playgroud)