1
votes

I have a ISAPI application written with Delphi. The application is compiled with runtime packages. Basically, all related bpls should deploy to an ISAPI enabled directory as well in order to get the ISAPI dll works. However, I always face errors when invoke ISAPI dll.

If my ISAPI dll doesn't compile with runtime packages, then it works fine.

The runtime packages should be the cause of the problems. The only solution so far I have is add the runtime packages path to system environment variable: %path% and restart the PC.

Is there any other solution available by not altering the environment variable?

I am using Windows 7 and IIS 7 and Delphi 2010.

3
Is there a specific reason why you are building with runtime packages?skamradt
Yes. Lots of reasons. I was a one file at runtime fan previously. I have abandoned this deployment strategy. With runtime packages, I can have more modular and logical view of my whole application architecture. Besides that, deploying with runtime packages allow us to load only packages that is necessary during runtime to save resourcesChau Chee Yang
I have news for you, you are not saving a lot of resources. The ISAPI.dll loads only once in the RAM memory. These days the servers have gigs of RAM memory, so saving a couple of megs won't matter. Plus the fact that if someone deletes one of your bpl files, you're DLL will fail.Dan S
If someone able to delete one of my bpl files, perhaps 90% of my other functions still work. If I only deploy a single ISAPI dll, whole application will not work anymore. My main concern isn't the resource problem but design and deploy with runtime packages make my application more structural and modular. This design also make pluggable application possible.Chau Chee Yang
While a pluggable application strategy makes sense for a windows program, it doesn't for a ISAPI one. Each request should be server stateless in order to scale, and each request atomic. Adding another DLL to the mix shouldn't be a problem.skamradt

3 Answers

1
votes

For the case where the ISAPI DLL and the runtime bpl's are in the same directory, check the file permissions on your ISAPI DLL and the runtime .bpl files, and make sure that the Internet Guest account has read+execute access to them.

0
votes

Have you tried placing .bpl files in directory where ISAPI dll is?

If this do not work then create installer for your ISAPI and this installer should copy all needed .bpl files to Windows system directory (you can get it using GetSystemDirectory() API function, usually this is <WindowsDir>\system32). For InnoSetup this is {sys} file destination.

0
votes

The BPL files MUST be in the system path of the machine OR in the directory of the executable (which in this case I believe is svchost.exe?). Now, the fun part. As each application is launched it grabs a snapshot of the environment at that time. If you add to the path, you will have to reboot the machine for it to become active, OR restart the application (which in this case involves restarting the OS).