2 ' Licensed to the Apache Software Foundation (ASF) under one or more
3 ' contributor license agreements. See the NOTICE file distributed with
4 ' this work for additional information regarding copyright ownership.
5 ' The ASF licenses this file to You under the Apache License, Version 2.0
6 ' (the "License"); you may not use this file except in compliance with
7 ' the License. You may obtain a copy of the License at
9 ' http://www.apache.org/licenses/LICENSE-2.0
11 ' Unless required by applicable law or agreed to in writing, software
12 ' distributed under the License is distributed on an "AS IS" BASIS,
13 ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ' See the License for the specific language governing permissions and
15 ' limitations under the License.
18 ' =========================================================================
19 ' Description: Install script for Tomcat ISAPI redirector
20 ' Author: Mladen Turk <mturk@apache.org>
21 ' Version: $Revision: 572120 $
22 ' =========================================================================
25 ' Get a handle to the filters for the server - we process all errors
29 filterName = "jakarta"
30 filterLib = "bin\isapi_redirect.dll"
32 Function IISInstallFilter(filterDir, filterObject)
35 Set filters = GetObject(filterObject)
37 info "Got Filters " + filters.FilterLoadOrder
40 ' Create the filter - if it fails then delete it and try again
43 info "Creating Filter - " + filterName
45 Set filter = filters.Create( "IISFilter", filterName )
48 info "Filter exists - deleting"
49 filters.delete "IISFilter", filterName
51 info "Error Deleting Filter"
55 Set filter = filters.Create( "IISFilter", filterName )
57 info "Error Creating Filter"
64 ' Set the filter info and save it
66 filter.FilterPath = filterDir + filterLib
67 ' filter.FilterEnabled = true
68 filter.FilterDescription = "Jakarta Isapi Redirector"
69 filter.NotifyOrderHigh = true
71 info "Created Filter " + filterDir + filterLib
74 ' Set the load order - only if it's not in the list already
77 loadOrders = filters.FilterLoadOrder
78 list = Split( loadOrders, "," )
81 If Trim( item ) = filterName Then found = true
85 info "Filter is not in load order - adding now."
86 If Len(loadOrders) <> 0 Then loadOrders = loadOrders + ","
87 filters.FilterLoadOrder = loadOrders + filterName
89 info "Added Filter " + filterName
91 info "Filter already exists in load order - no update required."
97 ' Helper function for snafus
99 Function fail(message)
100 ' MsgBox " " + message
105 ' Helper function for info
107 Function info(message)
108 ' MsgBox " " + message
111 info "Installing IIS Filter " + Session.Property("INSTALLDIR")
114 rv = IISInstallFilter(Session.Property("INSTALLDIR"), "IIS://LocalHost/W3SVC/1/Filters")
116 rv = IISInstallFilter(Session.Property("INSTALLDIR"), "/LM/W3SVC/Filters")
119 rv = IISInstallFilter(Session.Property("INSTALLDIR"), "/LM/W3SVC/1/Filters")