Hello there,
JH> Valery
JH> Can you explain to me how this script is working. I only seem to
JH> understand this up to the point of where it gets the W3SVC object.
JH> After that I'm a bit confused.
JH> Sorry to bother you on your personal email. If you want me to I can
JH> submit this to wix-users instead. I just thought that you were kinda
JH> enough to answer my first question in such a quick fashion that I might
JH> be able to sneak another one by you.
You SHOULD always channel your questions/asnwers through the WIX-users
list in order to save efforts for newcomers looking up for solution to
the same problem next time.
JH> Thanks in advance,
JH> John
JH> Function GetWebSites()
JH> Dim objIIS, oView, oSite, oServer, oReccombo
JH> Dim r
JH> On Error Resume Next
JH> Set objIIS = GetObject("IIS://localhost/W3SVC")
JH> If Err.Number <> 0 Then
JH> MsgBox "Unable to open IIS W3SVC Root object - " & _
JH> "please ensure that IIS is running" & vbCrLf & _
JH> " - Error Details: " & Err.Description & " [Number:" & _
JH> Hex(Err.Number) & "]", vbCritical, "Error"
JH> GetWebSites = ERROR_INSTALL_FAILURE
JH> Exit Function
JH> Else
JH> 'open and execute a view to the ListBox table
The following fragment is needed to be able to insert temporary
records into the ComboBox table (to fill in the web-sites combo with
entries)
JH> Set oView = Session.Database.OpenView("SELECT * FROM
JH> `ComboBox`")
JH> Set oPropertyView =
JH> Session.Database.OpenView("SELECT * FROM
JH> `Property` WHERE [Property] ='TARGETWEBCOMBO'")
JH> oView.Execute
JH> oPropertyView.Execute
JH> oPropertyView.Fetch
JH> r = 0
JH> For Each oSite in objIIS
in this loop you are iterating through the object under the w3svc node
JH> If oSite.Class = "IIsWebServer" Then
filtering out everything except what is of the "IIsWebServer" class
JH> r = r + 1
JH> Set oServer=GetObject(oSite.ADsPath)
JH> 'if r = 1 Then
JH> Session.Property("TARGETWEBCOMBO")= oSite.Name
JH> Session.Property("SERVERCOMMENT") = oServer.Get("ServerComment")
JH> 'End if
JH> '
JH> ' ComboBox record fields are Property, Order,
JH> Value, Text
JH> '
then you are creating blank four-field MsiRecord
JH> Set oReccombo = Session.Installer.CreateRecord(4)
and fill in its fields
JH> oReccombo.StringData(1) = "TARGETWEBCOMBO"
JH> oReccombo.IntegerData(2) = r
JH> oReccombo.StringData(3) = oSite.Name
JH> ' oReccombo.StringData(3) =
JH> oServer.Get("ServerComment")
JH> oReccombo.StringData(4) = oServer.Get("ServerComment")
and, finally, insert the record
JH> oView.Modify msiViewModifyInsertTemporary, oReccombo
JH> End If
JH> Next
JH> oView.Close
JH> 'return success to MSI
JH> GetWebSites = ERROR_SUCCESS
JH> End If
JH> 'clean up
JH> Set objIIS = Nothing
JH> Set oView = Nothing
JH> End Function
--
Best regards,
Valery mailto:[EMAIL PROTECTED]
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users