Deploying applications via MSI to IIS Servers

I recently received from a IIS administrator a message which posed a very good question.  He asked, I develop a ASP.Net application that I “zip” into a single .msi to deploy to a web application server.  I have 2 websites defined, each using a unique host header. 

The users issues though was related to where the MSI is installed to as it always defaults to the “Default Web Site” on IIS 6.0.  This includes even if he stops all other sites.  In IIS 5, he could effectively stop all sites except the one he is interested in and then run the .msi and it would work like a champ.  This isn't the case on IIS 6.0 ...

This was a really interesting question for which I pose to any or all listeners out there - ideas?  I would love to hear them. 

To simplify, I am going to insert parts of this customers email for you to validate information against -

Email with more details

Thanks for the response. Let me clarify. This is not an Asp.Net deployment issue, but rather deploying a web app written in asp.net, deployment issue. Also, it's really not an IIS issue (probably msi or vs

studio) but I have been unsuccessful in getting feedback.

I packaged a asp.net application into a .msi file for deployment to the prod web server. This is a Win2k3 (IIS 6.0) box. We've created two separate websites on this machine using dns entries, 1 IP address. We removed the default website. When we run the installer file, it always installs to the first web site.

In IIS 5.0, the behavior was to "shut down" all active websites except for the one you want to install too. This does not seem to work in IIS 6.0.

Do you have any suggestions or idea for targeting a specific website for a asp.net application using an installer file? I really can't use xcopy or manual techniques because it's a locked down server.

Original Email:

I'm having trouble finding support with an deployment issue I'm having

with asp.net and IIS 6.0. We have setup multiple websites on a server.

However, asp.net installer always installs to the first website it

finds. What technique can i use to have application install to a

specific website? I know this may be a windows installer issue, but I

figured, why not?

Look forward to hearing from everyone!

~Chris

5 Comments

  • This post was ported from Technet blog site to support my effort to centralized & simplify all my posts in one place. Because of this, I am going to post the comments from my question here -

    From David Wang:
    MSI has no native support for configuring IIS, ASP.Net, SQL, etc -- so when we are talking about "deploying applications via MSI to IIS Servers", you are really talking about some arbitrary MSI CustomAction DLL that performs this work.

    Thus, the issue has nothing to do with MSI nor IIS. It has everything to do with the functionality of this CustomAction DLL, which is really arbitrary behavior. This is why you see Visual Studio releasing the hotfix to dpca.dll and NOT IIS or MSI.

    An easy and free tool to create MSI and configure IIS is WiX ( http://www.sourceforge.net/projects/wix ). You will want to read along with Rob's blog when going this route ( http://blogs.msdn.com/robmen ).

    Finally, if MSI and WiX is not enough, you can always script IIS configuration with VBScript/JScript or managed code and launch that as a CustomAction from the MSI or standalone. In that case, your are the author of the "arbitrary" code...

  • From Tom Burns:

    There is a patch available from Microsoft Support to correct this issue.
    The correction includes two files, a replacement for \Common7\tools\deployment\dpca.dll and a script: EnableHostHeaders.js
    The main disadvantage is that you must run this script against the MSI after every build.
    This script patches the MSI file and changes it so that it will prompt you (with a drop down) of which website to install to.

  • From Shawn:

    personally, i've found that nant build scripts packaged in zip files tend to be the most useful installers for web apps. of course there are situations where you want a more novice user to install a web app, but for the most part, you're having administrative personnel doing it so it doesn't matter.

  • From Josh:

    I created MSI installs that were designed more as Applications and not Web sites. I then just uninstalled the msi and installed the new version. That way the app was installed in program files and it never touched the web settings in iis (which always ended up with a lot of customization). I probably could have scripted this, but never had the time.

    More recently, I have opted for a zip files because I hand them off to an admin to to deploy.

  • From Michael Toscano:

    Well I'll be... I was bit by just this problem over the past weekend. I haven't had a chance to resolve it yet but I was thinking I would take a look into the MSI by decompiling using the Wix tools or via Orca. My thought was to add a UI page to choose the website.

Comments have been disabled for this content.