mcuser
Posts: 13
Joined: Mon Jan 17, 2011 9:30 pm

ISAPI Filter (Jakarta)

Hi,

I am trying to install an ISAPI filter (Apache Jakarta Connector) on a web site created through the IIS tool of my Advanced Installer project. I use the Enterprise version of Advanced Installer.

I have read the How-To in the documentation (and read the posts, googled it, etc). The official way to do this is to add an ISAPI filter on the top node of the IIS section of my project. This seems to have absolutely no effect when running the MSI on Windows 2003 with IIS 6 (to be precise, even the virtual directory was not added), but even if it would, this is not at all what I am trying to achieve.

Here are the steps (manual steps) that need to be done ON A SINGLE WEB SITE (not the root node) to apply the Apache Jakarta Connector:
1 - Add virtual directory (pointing to dll and configs folder)
2 – Add an ISAPI filter (dll) to the web site
3 - Add a Web Service extension (allowed) for the ISAPI DLL

Can this be achieved with built in functions of an AI Enterprise project? Does it work for IIS 6 and IIS 7? If not, do you have a reference to a script that would make it happen?

Thank you.

[edit]The virtual folder do install properly on IIS 6, but not the ISAPI Filter, nor is it added in Web Service Extension.[/edit]
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: ISAPI Filter (Jakarta)

Hello and welcome to the Advanced Installer Forums,
This seems to have absolutely no effect when running the MSI on Windows 2003 with IIS 6 (to be precise, even the virtual directory was not added), but even if it would, this is not at all what I am trying to achieve.
I cannot reproduce this issue on my machine, can you please send us the .AIP (project) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them? Also, does this behavior manifest on all Windows 2003 machines?
Add virtual directory (pointing to dll and configs folder)
You can add a new virtual directory from the context menu of the selected web site. Once selected, you can then modify its general settings from the Virtual Directory tab in the right pane.
Add an ISAPI filter (dll) to the web site
For the moment, Advanced Installer has a predefined functionality to add only global ISAPI filters. Adding a filter on a single web site is on our TODO list and it will be available in a future version.
Add a Web Service extension (allowed) for the ISAPI DLL
You can try to add the extension as an application mapping from the web site's Application Mappings tab.
Does it work for IIS 6 and IIS 7?
Yes, it does.
If not, do you have a reference to a script that would make it happen?
Unfortunately, we don't have references to any script that would replace the missing predefined functionality.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mcuser
Posts: 13
Joined: Mon Jan 17, 2011 9:30 pm

Re: ISAPI Filter (Jakarta)

Hi,

Thank you for your answers.

As stated in my edit, I am now able to install the virtual directory.

As for the filter on a single site... well I guess I will be using it when it comes out! :) I am required to make it happen now, so I will post the scripts for both IIS 6 and IIS 7 when I am done.
You can try to add the extension as an application mapping from the web site's Application Mappings tab.
I think you misinterpret what I asked. I am not trying to map an extension to a DLL, I am trying to add the DLL as "allowed" in IIS through what is called "Web Service Extension" as show in following figure:

IIS Server
- Application Pools
- Web Sites
- Web Service Extension

Thank you.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: ISAPI Filter (Jakarta)

Hello,

I apologize for the misunderstanding.
I have discussed the issue with the development team and it seems we are currently working on this improvement. It will be available in a future version of Advanced Installer.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mcuser
Posts: 13
Joined: Mon Jan 17, 2011 9:30 pm

Re: ISAPI Filter (Jakarta)

As promised, here is the script (vbscript attached as .txt file) to add an ISAPI filter to a single web site in IIS 6. It uses WMI commands (IIS API) to update the MetaBase.xml file ([windows]\system32\inetserv\MetaBase.xml).

The Script assumes that there is already a site and a virtual directory created and properly configured (through Advanced Installer options) and that all necessary files (dll, configs) are part of the installation process.

I use a Custom Action in the “InstallIIS” sequence to run this script.

Note that you also need to have a script in the “Uninstall” sequence since removing a web site will not take care of Webservice Extentions clean up. Since it is a tiny code snipet, here it is:

Code: Select all

Dim wseExist
'Get ISAPI DLL path (arg)
jkFilePath=Session.Property("CustomActionData")
'Check if DLL exists then remove it
JkWebServiceExtensionExist jkFilePath, wseExist
If wseExist Then
	Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC")
	IISWebServiceObj.DeleteExtensionFileRecord jkFilePath
End If

'Checks if the ISAPI filter (DLL) exists in IIS Webservice Extensions
Function JkWebServiceExtensionExist(filePath, outParam)
	Set providerObj = GetObject("winmgmts://localhost/root/MicrosoftIISv2")
	outParam = false
	Set colItems = providerObj.ExecQuery("Select * from IIsWebServiceSetting")
	For Each objItem in colItems
		For i = 0 to Ubound(objItem.WebSvcExtRestrictionList)
			If objItem.WebSvcExtRestrictionList(i).FilePath = filePath Then
				outParam = true
				Exit For
			End If
		Next
		If outParam Then
			Exit For
		End If
	Next
End Function
As a last note, this is my first take at WMI and vbscript, so things might not be optimal and there might be a better way to do things. Feel free to comment my work.

The IIS 7 version will follow as soon as I am done.
Attachments
add_isapi.txt
(4.79 KiB) Downloaded 410 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: ISAPI Filter (Jakarta)

Hello,

This is available starting with version 10.0 of Advanced Installer released on March 21, 2013.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”