Skip to main content

dotNET - VS 2005 Web Deployment Projects + Installer (MSI) creation

You've got your Web Project in Visual Studio and you want to create a way to provide it as an installation.
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...
  • Notes:
  • 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.
If you choose option 2 then:
  • 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)

Comments

Shree said…
We normally add the project output and content files to the Setup project.How do we pipe in the O/p of the Web Deployment project to Web set up project?Do we still ahev to add the project output and content files to the Setup project?
Shree said…
This comment has been removed by the author.
Unknown said…
Hi,One of the primary features of Web Design Cochin is the ability to use the cluster screen shown above to deploy a new version of an application in a way that can be reversed at the first sign of trouble. This method requires more instances to be in use during deployment, but it can greatly reduce the duration of service outages caused by bad deployments.Thanks........

Popular posts from this blog

dotNET - Debugging

Debugging with .NET MSIL assemblies Visual Studio and debugging the CLR are different, I'll talk about both. MSIL Assemblies Assemblies compiled with .NET tools such as the CLR compiler are compiled into a file which contains MSIL (Microsoft Intermediate Language). At runtime the contents of the assembly are loaded into the CLR and ran as machine code. When you compile an assembly in debug a PDB file is generated alongside the DLL or EXE you've just created. The link between these 2 files is that the PDB contains the line numbers of the methods and classes as well as the file names of the original source code that created the assembly. When you launch the debugger in Visual Studio the assembly is loaded into the Debugger (similar to the CLR) along with the PDB file. The debugger now uses your PDB file contents to match the running code found in the assembly to locations in source files (hopefully in your present project). CLR CLR Inside Out (msdn magazine) .NET Framework Tools:...

Installer CustomAction, Debugging the CustomAction, InstallState

Custom Action The Custom Action is added to the Setup Project, select the Project node and hit the Custom Action button. This allows you add an Action to a particular phase in the Installation. But first you must create the Custom Action. To Add a Custom Action you must first have a Custom Action created, this is usually in the form of a Installer Class, this should be created in a seperate project, the Installer Class is actually one of the File Templates in the C# Projects. So it's File->New Project and select Visual C# Projects. Then add a Class Library, this will prompt you for the Class Library Types , select "Installer Class". Walkthrough - Creating Custom Action (msdn). Also here's a more comprehensive document on Setup/Installer implementations, it delves into the Registry etc Getting Started with Setup Projects (SimpleTalk). Visual Studio Setup Projects and Custom Actions (Simple Talk). Create your Installer Class and then add it as a Custom Action to the ...

Real-time Web Applications

Your application wants to show live data i.e. data sent from Server back up to the Client instead of the usual which is the Client sending data to the Server via a form submit. There are multiple options, currently the best option is WebSockets. Polling Periodically check the Server for updated data, uses SetInterval in Javascript. The Client sends some information to the Server and wants the Server to send back a response, the response is not immediate so the Client wants to wait for the Server but instead of waiting the Client keeps sending requests to the Server and when something is updated on the Server then the Client updates the UI. ( function poll (){ setTimeout ( function (){ $ . ajax ({ url : "server" , success : function ( data ){ //Update your dashboard gauge salesGauge . setValue ( data . value ); //Setup the next poll recursively poll (); }, dataType : "json" }); }, 30000 ); })(); https://...