Title: Re: Populate ComboBox from managed code using Custom

Here is something I compilated from others contributing in this list.


Function GetWebSites( )
    Dim oThisServer, oWebsite
    Dim intI

    On Error Resume Next
    Set oThisServer = GetObject( "IIS://localhost/W3SVC" )
     
    If( Err.Number <> 0 ) Then
        MsgBox "Unable to retrive websites - " & _
            "please ensure that IIS is running" & vbCrLf & _
            "    - Error Details: " & Err.Description & " [Number:" & _
            Hex(Err.Number) & "]", vbCritical, "Error"
            GetWebSites = ERROR_INSTALL_FAILURE
        Exit Function
    Else
    intI = 0   
    For Each oWebsite In oThisServer
        If oWebsite.Class = "IIsWebServer" Then
           
            If intI = 0 Then
                '
                ' Populates property TARGETWEBCOMBO with the first Website nr found, i.e 1 for Default Web Site
                '
                Session.Property("TARGETWEBCOMBO") = oWebsite.Name
            End If
            '
            ' Using AddToComboBox("TARGETWEBCOMBO", intI, oWebsite.Name,oWebsite.ServerComment )
            ' wil display website name in combobox and TARGETWEBCOMBO var in WiX will
            'contain the chosen websitenr not the string name from combobox
            '
            Call AddToComboBox( "TARGETWEBCOMBO", intI, oWebsite.Name, oWebsite.ServerComment )
            intI = intI + 1
        End If
    Next
    '
    ' Return Success to installer logic
    '
    GetWebSites = ERROR_SUCCESS
    End If
    ' Clean up
    Set oThisServer = Nothing
    Set oWebSite = Nothing
End Function

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to