tags:

views:

70

answers:

2

I am building a simple installer for a web application using Wix. I wish to use an existing app pool. The following code works as I want when installing the application.

<iis:WebAppPool Id='MyAppPool' Name='CRMAppPool'  />

This will set up the virtual directory using the existing CRMAppPool.

The problem is when, I uninstall the application, it deletes the app pool.

How can I prevent this?

+2  A: 

Put the WebAppPool element in it's own component and mark the component as permanent. The permananent attribute will ensure that the component is not removed upon uninstallation.

fletcher
If I were in the same room with you sir, I would so reach over and kiss you right now.THANKS!
NotMyself
+1  A: 

First I'd like to ask why you want to do this. I've always been really paranoid about sharing app pools once I first learned years ago that a .NET 1.1 webapp could JIT and then a .NET 2.0 webapp would fail.

Assumming you've considered all of this and really do want to share the app pool, I wouldn't do it with a permanent component and described above. I would instead do it with a shared component. Since App Pool's can't really be keyfiles I would create a fake registry key that services as the keyfile and put the app pool in as a companion resource.

I would then duplicate this component across all of my installs so that MSI can reference count the component and when the last install comes off the machine it will remove the app pool.

Christopher Painter