nvsoft
Posts: 19
Joined: Sat Feb 12, 2011 9:34 am

Use existing AppPool or create a new one

Hi,

I'm configuring Advanced Installer to create a new Web Site during installation.
I'd like this web site to use an AppPool with certain properties: .Net 4, "Integrated" mode & LocalSystem Identity.

In case such an AppPool exists, I'd like to use it. In case it does not exist, I'd like to create a new one.

I could not find an integrated way to search for an Application Pool (Is there a way to do so?) so I've created a Custom Action to check for the existence of such an AppPool and if one is found, its name is returned.

My problem is that when configuring my Web Site, on the Application Pool tab the options are: Inherit (not relevant for me), Use Installed A.P. & Use existing A.P.
As you can understand, I'll only know which option I'd like to use on run-time.
A possible solution would be to duplicate the Web Site and use a condition for both options but this seems like an overkill for such a small option selection.

Is there a solution which doesn't involve duplicating the Web Site definition?
Also, Is there an integrated way to search for an existing Application Pool?

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

Re: Use existing AppPool or create a new one

Hi,
Is there a solution which doesn't involve duplicating the Web Site definition?
From the IIS Page you can try to create an application pool that has a public property in the "Name" field. Configure it like you would if it wasn't present on the target machine. On your web site's application pool tab select the "Use existing application pool" and insert a formatted reference to the application pool I mentioned earlier. On the application pool's error policy you should select the "Prompt user to overwrite item or rollback installation". This way, even if the application pool exists on the target machine it will always get overwritten and your web site will be associated with it at install time.
Also, Is there an integrated way to search for an existing Application Pool?
We have the "Browse Application Pools" wizard which you could use for this purpose. You could parse the information from it, but please note that the attributes used are designed for visualization purposes and not for processing. Although, for a more specialized approach we recommend you use your own custom action to search for the application pool.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
nvsoft
Posts: 19
Joined: Sat Feb 12, 2011 9:34 am

Re: Use existing AppPool or create a new one

On the application pool's error policy you should select the "Prompt user to overwrite item or rollback installation".
Sorry, I forgot to reference this solution in my original post.
I don't think my users have to make decisions about Application Pools nor do they have the knowledge to (as end-users, they don't need to know such a thing even exists).

Generally speaking, I think you should add an option to "Overwrite existing without prompting the user" in all property pages with an error policy all over Advanced Installer. I do not wish to bother my users with questions about Application Pools and not having an option to overwrite without prompting makes this option unusable for me.

I guess I'll duplicate the Web Site definition after all.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Use existing AppPool or create a new one

Hi,
I think you should add an option to "Overwrite existing without prompting the user" in all property pages with an error policy all over Advanced Installer.
Thank you for your suggestion. However, we believe that overwriting an application pool could have destructive consequences for the server on the target machine so prompting for confirmation every time should be the error policy.

If you want to perform a search for the application pool you should return the result in a public property. If the application pool with your three desired attributes exists on the target machine, you can modify the name of the installed application pool( which should be a public property referenced in the application pool tab of the web site as well ) to match the one on the target machine. In this case you can have any error policy and an overwrite will never occur. Also, add your search result public property as an install condition to the application pool. This way, if the application pool exists, the installer will simply place the web site inside it without any overwrite, and if not, it will create a new application pool with your desired attributes.

However, to avoid any complications and since we are talking about a non-expensive resource, we recommend you create your own application pool on every install, assign it with a particular name associated with your application and configure it accordingly.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”