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

How to install an ISAPI filter for website created by InstallShield 2010

By default, when my InstallShield setup.exe creates a website for IIS 6, I looked at the metabase.xml file and observed that it does not create an entry of the form:


AdminACL="...." />

where: 223085046 is the siteId for the website.

If it did, I could use the following code to add my ISAPI filter:
Dim FiltersObj
Dim FilterObj
Dim LoadOrder
Dim FilterName
Dim FilterPath
Dim FilterDesc

FilterName = "myFilter"
FilterPath = "C:\iisfilts\myfilter.dll"
FilterDesc = "This is my filter"

Set FiltersObj = GetObject("IIS://LocalHost/W3SVC/siteId/Filters")
LoadOrder = FiltersObj.FilterLoadOrder
If LoadOrder <> "" Then
LoadOrder = LoadOrder & ","
End If
LoadOrder = LoadOrder & FilterName
FiltersObj.FilterLoadOrder = LoadOrder
FiltersObj.SetInfo

Set FilterObj = FiltersObj.Create("IIsFilter", FilterName)
FilterObj.FilterPath = FilterPath
FilterObj.FilterDescription = FilterDesc
FilterObj.SetInfo

Is there a way to have InstallShield add the above IIsFilters Location information to the IIS 6 metabase when it creates the website?

If not, is there a work around that you can point me to?

many thanks!
henryt
Labels (1)
0 Kudos
2 Replies
Highlighted
Pilgrim

the answer!

(1) Run this cscript:

C:\>cscript c:\Inetpub\AdminScripts\adsutil.vbs CREATE W3SVC/3001/Filters "IIsFilters"

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

created "W3SVC/3001/Filters"


(2) Then run this vbscript

Dim FiltersObj
Dim FilterObj
Dim LoadOrder
Dim FilterName
Dim FilterPath
Dim FilterDesc

FilterName = "ht"
FilterPath = "C:\ht.dll"
FilterDesc = "HT Filter"

Set FiltersObj = GetObject("IIS://LocalHost/W3SVC/3001/Filters")
LoadOrder = FiltersObj.FilterLoadOrder
If LoadOrder <> "" Then
LoadOrder = LoadOrder & ","
End If
LoadOrder = LoadOrder & FilterName
FiltersObj.FilterLoadOrder = LoadOrder
FiltersObj.SetInfo

Set FilterObj = FiltersObj.Create("IIsFilter", FilterName)
FilterObj.FilterPath = FilterPath
FilterObj.FilterDescription = FilterDesc
FilterObj.SetInfo
0 Kudos
Highlighted
Pilgrim

solution using only script

(1)
cd c:\Inetpub\AdminScripts

(2)
cscript adsutil.vbs create W3SVC/3001/Filters "IIsFilters"
metabase shows:


(3)
cscript adsutil.vbs set w3svc/3001/filters/filterloadorder "My ISAPI Filter"
metabase shows:


(4)
cscript adsutil.vbs create "w3svc/3001/Filters/My ISAPI Filter" "IIsFilter"
metabase:


(5)
cscript adsutil.vbs set "w3svc/3001/Filters/My ISAPI Filter"/FilterPath "C:\My.dll"

(6)
cscript adsutil.vbs set "w3svc/3001/Filters/My ISAPI Filter"/FilterDescription "My Filter"

(7)
cscript adsutil.vbs set "w3svc/3001/Filters/My ISAPI Filter"/FilterFlags 0

final metabase result:



😄
0 Kudos