cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Site Number For Existing Website.

Get Site Number For Existing Website.

Synopsis

This helpnet article gives instructions on how to have the installer automatically detect the next available site number and use it to install the website.
http://helpnet.flexerasoftware.com/installshield22helplib/helplibrary/IISPortSiteNo.htm

However, this will have the installer still attempt to add a new site even if a site with the same name already exists.


Discussion

The following VbScript code can check for an existing website and get the Site Number.

Dim objW3SVC, objIisWebSite

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

For Each objIisWebSite In objW3SVC
If objIisWebSite.Class = "IIsWebServer" Then


MsgBox objIisWebSite.Name ' SiteNumber
MsgBox objIisWebSite.ServerComment ' SiteName
if objIisWebSite.ServerComment = Session.Property("SSWEBSITE") then
Property("SSNEXTNEWSITENUMBER")=objIisWebSite.Name
end if
end if
next


The MSI Property SSWEBSITE should be set the site name being checked.
The MSI Property SSNEXTNEWSITENUMBER is where the site number is stored if the existing Website is found.

This vbscript can be called from a vbscript custom action.
Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎May 18, 2018 02:07 AM
Updated by: