timc
Posts: 20
Joined: Wed Apr 30, 2008 12:43 am

How best to install ISAPI filters?

Hi,

I'm migrating an old Wise installer to AI, and one of the last requirements is to set up IIS (at least versions 5.1 and 6) with an ISAPI filter for Tomcat. It needs to be applied to the default web site, for use with virtual directories that are created during the install. It may also work to apply it globally. I'm using an attached custom action to install the filter, but it is throwing an error 1720 on install, and leaving things in a half-installed state. I've got a second function to uninstall, but have not gotten to the point of testing it yet.

My first priority it to get IIS to redirect servlets to Tomcat. I don't care how, but am constrained to making this work like the legacy installer.

Here is the install function. It's based on http://msdn.microsoft.com/en-us/library ... S.85).aspx.

"""
option Explicit

Sub InstallIsapiFilter
Dim appdir
appdir = Session.Property("CustomActionData")
MsgBox appdir

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

FilterName = "Envision_ISAPI"
FilterPath = appdir & "isapi_redirect.dll"
FilterDesc = "Envision_ISAPI"

Set FiltersObj = GetObject("IIS://LocalHost/W3SVC/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
End Sub ' InstallIsapiFilter
"""

Thanks,
Tim
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: How best to install ISAPI filters?

Hi Tim,

Please note that Advanced Installer allows you to use ISAPI filters through the IIS page. In order to add an ISAPI filter you can try following these steps:
- go to the "IIS" page
- select "IIS Server" in the tree
- add your DLL in the "ISAPI Filters" section

If you don't want to use the Advanced Installer support and instead you want to use a custom action, first you need to find the problems in the code. The error 1720 means: "There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action [2] script error [3], [4]: [5] Line [6], Column [7], [8]"

More details about what triggers this error can be found in the installation log.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
timc
Posts: 20
Joined: Wed Apr 30, 2008 12:43 am

Re: How best to install ISAPI filters?

Hi Cosmin,

I'm getting ahead of myself. I first tried adding the DLL in the "ISAPI filters" section, but it was not loaded or even listed in the IIS admin tool. Eventually I found that the filter loads consistently in IIS 5.1 (Windows XP), but not in IIS 6.0 (Server 2003).

I would rather use the Advanced Installer support, and tried the custom action because of pressure to get this fixed as quickly as possible. If it helps, I've included a small installer project that has the problem.

Thanks in advance,
Tim
isapi.zip
(126.88 KiB) Downloaded 260 times

Return to “Common Problems”