Morton,

I'm not sure why calling a script makes the code messy and maintenance much
harder. Especially compared to calling a dll. 

Here's the script I use to load a dropdown list of available (already
defined) websites on a server.

Note: It sets the property WEBSITE to the name of the first website found
(typically "Default Website"). It adds any defined websites to the combobox
named WEBSITE. It sets the property NUMWEBSITES to the number of websites
found.


option explicit


Function InitializeWebserverCombo()
    Dim ThisServer
    Dim Website
    dim i
    dim s

    Set ThisServer = GetObject("IIS://localhost/W3SVC")

    i = 1    
    For Each Website In ThisServer
        If Website.Class = "IIsWebServer" Then
            if i = 1 then
                Session.Property("WEBSITE") = Website.Name
            end if              
            call AddToComboBox("WEBSITE", i, Website.Name,
Website.ServerComment)
            i = i + 1
        End If
    Next
    
    Session.Property("NUMWEBSITES") = (i - 1) & ""

End Function



Sub AddToComboBox(ByVal ComboProp, ByVal ComboOrder, ByVal ComboValue, ByVal
ComboText)

    ' This function takes values passed into it from the function call and
uses these values to create
    ' and execute a view within the current session of the Windows Installer
object.  This view is based
    ' on a SQL query constructed using the values passed into the function.
If you wish to get a deeper
    ' understanding of how this function works you should read up on the
Windows Installer object
    ' model in the Windows Installer SDK.

    ' Initialize variables
    Dim query
    Dim view

    ' Construct query based on values passed into the function.
    ' NOTE:  The ` character used is not a single quote, but rather 
    '        a back quote.  This character is typically found on the 
    '        key used for the ~ symbol in the upper left of the keyboard.

    query = "INSERT INTO `ComboBox` " _
             & "(`Property`, `Order`, `Value`, `Text`) " _
             & "VALUES ('" & ComboProp & "', " & ComboOrder _
             & ", '" & ComboValue & "', '" & ComboText & "') TEMPORARY"

    '
    ' Creates the view object based on our query
    '
    set view = Session.Database.OpenView(query)

    '
    ' Invoke the query to add the combo value
    '
    view.Execute

End Sub



Regards,

Rob

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lerudjordet,
Morten Minge
Sent: Wednesday, September 06, 2006 2:48 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Bit of a twist



Hi, been fooling around with the IIS extension a couple of days. 
I found out that I needed to be able to give the user a choose of Website to
install to, just so no typing error can occur.

As I did not find any extensions that can be used to read the state of the
IIS server, I need to find another solution. 

I don't want to be stuck calling a script because it will make the code
messy and maintenance much harder. 

That is why I started thinking about custom actions and exposing a dll with
the relevant methods (a bit of work and maintenance falls on me)

Does anybody know if there already exist a solution I can use, i.e. Windows
Installer extension. Visual Studio embeds a custom dll call to read the IIS
state, so there must be something like that I can use?

(probably need to figure how to copy a appPool by existing template later so
finding ways to read state is a must, just don't want to depend on user
input).

Any help is welcome 

Regards 
Morten  





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