Installing a Web Application to an Existing IIS Website using Wix3

[article]
Summary:
This article describes a detailed procedure for installing a new web application on an existing IIS website, when Wix3 is used to create the msi file. This can be a common requirement in a large deployment. However, I find it's a lot of work to actually get it done,

This article describes a detailed procedure for installing a new web application on an existing IIS website, when Wix3 is used to create the msi file. This can be a common requirement in a large deployment. However, I find it's a lot of work to actually get it done,

1    The Requirement
The SFS application I am working on used to have a fixed installation directory under the Default Web Site which is "C:\inetput\wwwroot\SFS". And one day we got a message from our deployment team:

Installing a new (or existing) web application into our Production cluster may seem like a simple thing, but believe me, there are a variety of things that make it just complex enough to need to be explained and just complex enough that the MSI you create to install an application needs to be smarter than you think.

  1. First of all, an application gets installed into a web site.  Our Production servers have more than one web site on them:  Intranet, Extranet, Public, etc.  When your setup program tries to install itself, if it does not specify a particular web site it will "choose" the first one that it gets from IIS.  This is most likely the Default Web Site, but not always, and, depending upon the accessibility of the application (Extranet vs. Intranet) it may not even be the correct site.  If it is not the correct site we have to try and move it from one site to another, but any special configuration that may have occurred may not be moved over causing no end of grief for both you and us.  As a result, your setup program needs to query IIS with regard to the web sites that are available and provide a drop down list to the person doing the installation so that they can pick the correct site.
  2. Next, an application needs to tell us which Virtual Directory it needs to get installed in.  Pretty straight forward.  Your setup program needs to prompt for this with the default being where you are expecting it to be.
  3. OK, next step, application pool.  While applications don't need their own application pool it makes things a lot easier to troubleshoot and manage if they do.  As a result, the setup program needs to prompt for the Application Pool that the application should be using after it is installed.
  4. Also finished.  If your setup program makes changes to config files based on the environment (thank you!!!) then you need to provide a list of environments for which you can make changes.  A drop down list, a set of radio buttons, anything that allows us to pick an environment would be preferred as opposed to a free form text field.  If it is free form , do you want "Production", "PROD", "Prod" or "P"?  Things should be as simple as possible.
  5. Last thing:  is there some way to run your MSI in an automated fashion, without human intervention?  What if we used a different process for installing your application and had automated deployments set up for 4:00 AM.  How do we set all of the parameters for your application?  Can it be done?  Think about it.

And below was the sample screen they gave me:

jhaug09-1.jpg

Note: To install in the root directory of the selected website, leave the Virtual Directory field empty. Or, you can specify the Virtual Directory to create/update a virtual directory under the selected website.

2    Microsoft Fix
Microsoft actually released a fix to provide a solution for this problem:
"FIX: You cannot deploy a Web Setup project to Web sites by using

Pages

About the author

TechWell Contributor's picture TechWell Contributor

The opinions and positions expressed within these guest posts are those of the author alone and do not represent those of the TechWell Community Sites. Guest authors represent that they have the right to distribute this content and that such content is not violating the legal rights of others. If you would like to contribute content to a TechWell Community Site, email editors@techwell.com.

CMCrossroads is one of the growing communities of the TechWell network.

Featuring fresh, insightful stories, TechWell.com is the place to go for what is happening in software development and delivery.  Join the conversation now!

Upcoming Events

Oct 21
Nov 09
Nov 09
Apr 13