C# – Web Project MSI for iis6 and iis7

asp.netciis-6iis-7

I have the need to create a web setup project for some of our web applications. We have clients on both IIS6 and IIS7. I want to create an MSI, or some type of setup project that allows me to do the following:

1) Detect if databases exist. If they don't create the database and their objects
2) Select the directory where the files should target
3) Detect if the correct websites exist. If they don't create a website and the virtual directories. Some of the virtual directories also have security settings that will need to be set

I am comfortable creating MSI's to handle this level of customization. I plan on using osql and scripts to handle the database deployments.

I have 2 questions. First, is there a better way (other than MSI's) to attempt this? Secondly, what is the best way to handle the different versions of IIS? Should I just use WMI and ensure that IIS 6 compatibility is turned on for IIS7?

Any suggestions would be greatly appreciated.

Best Answer

MSdeploy and Web Platform installer can do the job. WPI will also take care off all the dependicies for your application such as SQL server, IIS, MySQL. Asp.net, PHP, etc if they are not installed. WPI is totally customizable and uses xml for configuration.

read this guide (http://learn.iis.net/page.aspx/578/package-an-application-for-the-windows-web-application-gallery/), and ignore where Microsoft asks you to submit your application to their application gallery.

Once you package your application and configure WPI to use local xml configuration files then everything will become breeze.

also read: http://learn.iis.net/page.aspx/617/web-platform-installer-resources/