6 Dim WebObj, WebSite, WebSiteRoot
\r
10 Dim line, lineArray, lineIndex
\r
13 Dim newWebSvcExtLine
\r
14 Dim customData, msiProperties, InstallDir, ShibFileExtension, LogFile
\r
16 'Get the INSTALLDIR and SHIB_FILE_EXTENSION values via CustomActionData
\r
17 customData = Session.Property("CustomActionData")
\r
18 msiProperties = split(customData,";@;")
\r
19 InstallDir= msiProperties(0)
\r
20 ShibISAPIPath = msiProperties(1)
\r
21 ShibFileExtension = msiProperties(2)
\r
23 Set FileSystemObj = CreateObject("Scripting.FileSystemObject")
\r
25 Set LogFile = FileSystemObj.OpenTextFile(InstallDir & "\var\log\shibboleth\Installer.log", 8, true)
\r
27 LogFile.WriteLine "Configure IIS plugin DLL " & ShibISAPIPath & ", Extension = " & ShibFileExtension
\r
29 On Error Resume Next
\r
30 Set WebObj = GetObject("IIS://LocalHost/W3SVC")
\r
33 'Remove all trailing backslashes to normalize
\r
34 do while (mid(InstallDir,Len(InstallDir),1) = "\")
\r
35 InstallDir = mid(InstallDir,1,Len(InstallDir)-1)
\r
37 ' ShibISAPIPath = InstallDir & "\lib\shibboleth\isapi_shib.dll"
\r
38 'Make sure ShibFileExtension is in proper format
\r
39 'First, strip any preceding periods
\r
40 do while (mid(ShibFileExtension,1,1) = ".")
\r
41 ShibFileExtension = mid(ShibFileExtension,2,Len(ShibFileExtension)-1)
\r
43 'If there is nothing left (or was nothing to begin with), use the default
\r
44 if (ShibFileExtension = "") then
\r
45 ShibFileExtension = ".sso"
\r
47 'Add preceding period
\r
48 ShibFileExtension = "." & ShibFileExtension
\r
51 'Specify other ISAPI Filter details
\r
52 FilterName = "Shibboleth"
\r
53 FilterPath = ShibISAPIPath
\r
56 Set FiltersObj = GetObject("IIS://LocalHost/W3SVC/Filters")
\r
57 LoadOrder = FiltersObj.FilterLoadOrder
\r
58 'Check to see if 'Shibboleth' is already sequenced
\r
59 existsFlag = "not_exist"
\r
60 lineArray = split(LoadOrder, ",")
\r
61 for each line in lineArray
\r
62 if (line = FilterName) then
\r
63 existsFlag = "exists"
\r
66 if (existsFlag = "not_exist") then
\r
67 If LoadOrder <> "" Then
\r
68 LoadOrder = LoadOrder & ","
\r
70 LoadOrder = LoadOrder & FilterName
\r
71 FiltersObj.FilterLoadOrder = LoadOrder
\r
74 'msgbox "Shib Filter already sequenced"
\r
77 Set FilterObj = FiltersObj.Create("IIsFilter", FilterName)
\r
79 'Open existing filter for updating
\r
81 Set FilterObj = GetObject("IIS://LocalHost/W3SVC/Filters/" & FilterName)
\r
83 FilterObj.FilterPath = FilterPath
\r
84 FilterObj.FilterDescription = FilterDesc
\r
87 'Create file extension mapping to ISAPI filter
\r
88 newScriptLine = ShibFileExtension & "," & ShibISAPIPath & ",1"
\r
89 ScriptMaps = WebObj.ScriptMaps
\r
91 existsFlag = "not_exist"
\r
93 for each line in ScriptMaps
\r
94 lineArray = split(line,",")
\r
95 if (lineArray(0) = ShibFileExtension) then
\r
96 existsFlag = "exists"
\r
99 lineIndex = lineIndex + 1
\r
101 if (existsFlag = "not_exist") then
\r
102 redim preserve ScriptMaps(UBound(ScriptMaps)+1)
\r
103 ScriptMaps(UBound(ScriptMaps)) = newScriptLine
\r
104 WebObj.ScriptMaps = ScriptMaps
\r
107 'msgbox ".sso already exists: " & lineIndex
\r
108 'We already warned user in dialog that this value would be updated
\r
109 ScriptMaps(lineIndex) = newScriptLine
\r
110 WebObj.ScriptMaps = ScriptMaps
\r
114 'Create file extension mapping to filter on each web site root
\r
115 For Each WebSite in WebObj
\r
116 Set WebSiteRoot = GetObject(WebSite.ADsPath & "/ROOT")
\r
118 ScriptMaps = WebSiteRoot.ScriptMaps
\r
120 existsFlag = "not_exist"
\r
122 for each line in ScriptMaps
\r
123 lineArray = split(line,",")
\r
124 if (lineArray(0) = ShibFileExtension) then
\r
125 existsFlag = "exists"
\r
128 lineIndex = lineIndex + 1
\r
130 if (existsFlag = "not_exist") then
\r
131 redim preserve ScriptMaps(UBound(ScriptMaps)+1)
\r
132 ScriptMaps(UBound(ScriptMaps)) = newScriptLine
\r
133 WebSiteRoot.ScriptMaps = ScriptMaps
\r
134 WebSiteRoot.SetInfo
\r
136 'msgbox ".sso already exists: " & lineIndex
\r
137 'We already warned user in dialog that this value would be updated
\r
138 ScriptMaps(lineIndex) = newScriptLine
\r
139 WebSiteRoot.ScriptMaps = ScriptMaps
\r
140 WebSiteRoot.SetInfo
\r
146 'Web Services Extension
\r
148 WebSvcExts = WebObj.WebSvcExtRestrictionList
\r
150 newWebSvcExtLine = "1," & ShibISAPIPath & ",1,ShibGroup,Shibboleth Web Service Extension"
\r
152 existsFlag = "not_exist"
\r
154 for each line in WebSvcExts
\r
155 lineArray = split(line,",")
\r
156 if (lineArray(1) = ShibISAPIPath) then
\r
157 existsFlag = "exists"
\r
160 lineIndex = lineIndex + 1
\r
163 if (existsFlag = "not_exist") then
\r
164 redim preserve WebSvcExts(UBound(WebSvcExts)+1)
\r
165 WebSvcExts(UBound(WebSVCExts)) = newWebSvcExtLine
\r
166 WebObj.WebSvcExtRestrictionList = WebSvcExts
\r
169 'msgbox "Shibboleth Web Services Extension already exists: " & lineIndex
\r
170 'We already warned user in dialog that this value would be updated
\r
171 WebSvcExts(lineIndex) = newWebSvcExtLine
\r
172 WebObj.WebSvcExtRestrictionList = WebSvcExts
\r
178 LogFile.WriteLine " Could not locate IIS adaptor"
\r