PDA

View Full Version : IIS Functionality Questions...



Jason Davis
05-13-2004, 06:59 AM
I probably missed where it's been mentioned, but haven't seen these particular things addressed in documention yet. I also haven't downloaded an Eval copy yet and reviewed that documentation.

Can IS X be used to create application pools and assign virtual directories to those application pools in IIS 6.0?

Can IS X locate and collect lists of existing Web sites, application pools, and virtual directories?

If you can get lists of these sorts of things - then you can do things like make sure a virtual directory you want to create doesn't already exist under a given selected web site, or present alist of existing web sites to a user and let them select where they want to put a virtual directory they want to create, etc., etc., etc.

Thanks.

RichAquino
05-13-2004, 09:15 AM
Hi Jason,

Currently, our IIS support does not support Application Pools.

Also, there is not a "baked in" way of querying the system for existing websites, application pools, or virtual dirs.

However, there is a workaround...

The important fields of a website (port and site number) are property enabled. So, if you had a vbscript (i.e. a modified version of the samples installed with IIS) that detected your website, providing you with the site number, it could set the property value (i.e. [MY_SITE_NUMBER]) to that value. This would in essense select the site you want.

You may also conditionally install a virtual directory by setting a condition on the virtual directory's component. It would be best to use a property (i.e. [INSTALL_THIS_VROOT]). A similar vbscript (or any type of custom action) may be used to determine if the virtual directory exists, and set the property to true if it doesn't.

Rich

johnludlow
05-13-2004, 09:37 AM
This thread has an example script showing how to query the machine for websites and display them in a listbox.

http://community.installshield.com/showthread.php?s=&threadid=126395

Jason Davis
05-13-2004, 10:03 AM
Thanks guys for the reply.

I have a utility that we wrote that helps me with these sorts of tasks immensely (it doesn't handle App Pools yet...). I was hoping this might be in X, so I could stop relying on this utility and the issues that doing so creates over time for different OS versions.

I did think of one more question, though -

I need to ask my users during installation what they want to call their virtual directory - then that name gets used to create the virtual directory under the web site of their choice.

Does X allow the name of the virtual directory --- that you skeleton out when developing the install -- to be a property that is collected during runtime during the Q & A portion of the install?

Thanks again.

David Thornley
05-13-2004, 10:20 AM
Yes it does, for MSI projects you can use installer properties.

RichAquino
05-17-2004, 01:21 PM
Also, for InstallScript projects, you may use text substitutions.

So it's...
Msi - [PROPERTY_NAME]
InstallScript - <PROPERTY_NAME>

zeplynne
05-19-2004, 07:56 PM
I have created a function to create a drop down with the sites in IIS. The combobox has a custom action attached to it 'DoAction' calling VBScript Function IISWebSites. Unfortunately, the combobox does not populate when you come to the new dialog I put it on. You have to hit 'next' or 'back' and come back to the dialog and then the combobox has values in it. I have provided the function below for review. Maybe someone can tell me if I am missing a step or executing something improperly. Thanks for your time.

Const IDOK = 1

Function IISWebSites()
Dim objView, objRecord, viewList, recList
Dim objW3SVC, objIISWebSite, intOrder

'Delete any records that may exist
Set viewList = Database.OpenView("SELECT * FROM `ComboBox`") 'WHERE `Property`='SCTIISWEBSITE'")
viewList.Execute
Set recList = viewList.Fetch

'delete any existing records
While Not (recList Is Nothing)
viewList.Modify 6, recList ' 6 = delete
Set recList = viewList.Fetch
Wend
viewList.Close

'Start to populate combo box with IIS web sites found
Set objView = Database.OpenView("select * from `ComboBox`") 'where `Property` = 'SCTIISWEBSITE'")
objView.Execute
'enumerate webservers on localhost and populate ComboBox table
Set objW3SVC = GetObject("IIS://localhost/W3SVC")
intOrder = 1

For Each objIISWebSite In objW3SVC
If objIISWebSite.Class = "IIsWebServer" Then
'add site name to ComboBox table (which is used by our dialog ComboBox)
Set objRecord = Installer.CreateRecord(4)
objRecord.StringData(1) = "SCTIISWEBSITE" 'property
objRecord.IntegerData(2) = intOrder 'order
objRecord.StringData(3) = objIISWebSite.Name 'value (WebSite number)
objRecord.StringData(4) = objIISWebSite.ServerComment 'text (WebSite Name)

'now add the record to the table
call objView.Modify(7,objRecord)
intOrder = intOrder + 1
'MsgBox(objRecord.StringData(4))
'call objRecord.ClearData()
End If
Next
objView.Close
IISWebSites = IDOK
End Function

johnludlow
05-20-2004, 04:05 AM
Attach the custom action to the next button of the previous dialog.

zeplynne
05-20-2004, 07:22 AM
Thanks, that did it.

johnludlow
05-20-2004, 07:54 AM
No problem