There are 2 ways to do this:
1. Create a Web Deployment Project from your Web Project and then use the output of this as the input to another project, a Setup Project.
After you've achieved this you'll have an MSI installer file which has configurable elements, these configurable elements will be dictated by yourself when creating the Web Deployment Project and the Setup Project.
2. Create a WebSetup project from your Web Project.
After you've achieved this you'll have an MSI installer file.
Option 2 is the simpler option.
The difference between the 2 options is that the first provides extra control using the Deployment project, such things a MSBuild and assembly type deployment.
If you choose option 1 then:
- You can quickly create a Web Deployment Project by right-clicking the Web Project in the Visual Studio Solution Explorer. This will copy the contents of your Web Project into the new Deployment Project. See the links below on how to customise the settings.
- The Setup Project uses the Web Deployment Project, this is achieved by adding the Web Deployment projects output as a reference, Right Click on the Setup Project...
- I noted during the Web Deployment Project creation that;
- Changing the Project Properties does not always apply e.g. I changed the Property Pages->Deployment section to "appsettings=appsettings.config", this indicates the appsettings section of the Websites web.config should be overridden with that in the appsettings.config file in the source Web Project. But the appsettings is case-sensitive, I fixed it but it still did not apply resulting in a compilation error, I had to edit the project file itself using the VS editor. The contents of the appsettings.config file is the complete appSettings section, including the appSettings tags.
- The appSetting file is located in the original Web Project.
- Using appSettings=appsettings.config in the Web Deployement Project's Property Pages->Deployment section it overrides the appSettings section.
- This is a much simpler solution and really just copies the contents of your Web project into an exe or msi file for later installation.
- Create a Web Setup project from the File->New Project dialog, under Setup and Deployment.
- Add the Web site project's Output as a reference in the WebSetup project.
For both option 1 and 2 you'll need to create some sort of Setup project, either a Setup project (Option 1. which uses the output of the Web Deployment project) or a Web Setup project (Option 2. which uses the Web project directly).
For more on both types of Setup project and how to use the user input see the article later in this blog dotNET - Setup Programs Installer creation using VS2005
Using Web Deployment Projects with Visual Studio 2005 (msdn)
ScottGu's Blog - VS 2005 Web Deployment Projects
Modifying Web.Config during Website Installation (AspAlliance)