This blog post has a C# example:

http://blog.torresdal.net/2008/10/24/WiXAndDTFUsingACustomActionToListAvailableWebSitesOnIIS.aspx

Here are the relevant pieces:

The ListBox table has these four columns:
  * Property
  * Order
  * Value
  * Text

private static void StoreWebSiteDataInListBoxTable(DirectoryEntry webSite, int 
order, View listBoxView)
{
    Record newListBoxRecord = new Record(4);
    newListBoxRecord[1] = "WEBSITE";
    newListBoxRecord[2] = order;
    newListBoxRecord[3] = webSite.Name;
    newListBoxRecord[4] = webSite.Properties["ServerComment"].Value;
    listBoxView.Modify(ViewModifyMode.InsertTemporary, newListBoxRecord);
}

The listBoxView parameter above is passed this value:

View listBoxView = session.Database.OpenView("select * from ListBox");

Translating this to VB.NET should not be too difficult.

Edwin G. Castro
Software Developer - Staff
Digital Channels
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail

> -----Original Message-----
> From: Matt Walker [mailto:mawa...@rcn.com]
> Sent: Monday, August 08, 2011 1:07 PM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Populating a ListBox At Runtime - VB.NET Custom Action
> Project...
> 
>     I don't know if I'm on the right path, but maybe someone can help me.
> I'm
> 
>     currently using InstallShield, but have dabbled in WiX a bit.
> 
>     I'm trying to creat a custom action using the WiX VB.NET custom action
> 
>     project type in VS 2010. Eventually this custom action will query the 
> target
> 
>     system for existing web sites by name and populate a combo box for
> 
>     selection, but for now, I just have an array of values that I want to 
> shove
> 
>     into the listbox just to see that I have working code.
> 
>     The associated property on my listbox is WEBSITECHOICES and I know that I
> 
>     have to get the choices into the listbox table, but that is where I hit 
> the
> 
>     wall. I've tried so much that my head is spinning. Does someone out there
> 
>     have a VB.Net code snippet of how to use the Session.OpenView, etc to
> 
>     populate this table with my array values?
> 
> 
> 
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-
> attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to