Deployment
projects in Visual Studio
In
Visual Studio there are four types of deployment
projects namely
·
Merge Module Project
·
Setup Project
·
Web
Setup Project
·
Cab
Project
The
Setup Wizard facility assists you to step through
the process of creating deployment projects. The
following Table 1
|
Project Type |
Purpose |
|
Merge Module Project |
Packages components that might be shared by
multiple applications. |
|
Setup Project |
Builds an installer for a Windows-based
application. |
|
Web
Setup Project |
Builds an installer for a Web application. |
|
Cab
Project |
Creates a cabinet file for downloading to a
legacy Web browser. |
Merge Module projects permits you to
package files or components into a single module to
facilitate sharing. It allows you to create reusable
setup components. The ensuing merge module
(.msm) files can be incorporated to any other
deployment project. To package ActiveX components
you can employ Cab projects to generate .cab file
that can be downloaded from a Web server to a Web
browser. In the Setup project, the installer will
install files into a Program Files directory on a
target computer. In the Web Setup project, the
installer will install files into a Virtual Root
directory on a web server.
Deploying a Web application Project (Web Setup
Project)
Let
us explore in detail steps about how to deploy a Web
application Project as follows.
·
Open an existing ASP.NET Web application project
(For example we call it as DepWebProject with Visual
Studio .NET.
·
On
the File menu, click Add Project, and then New
Project.
·
In
the resulting Add New Project dialog box, select the
Setup and Deployment Projects folder; select Web
Setup Project, type a name for your deployment
project in the Name box, as shown in the Figure 7
and then click OK.
·
This will include the Web Setup Project (WebSetup1)
to the existing solution and opens the File System
Editor.
·
In
the File System Editor, click the Web Application
folder.
·
On
the Action menu, point to Add, and then click
Project Output as shown in the figure 8.

Figure 7: Add New Project Dialog Box.

Figure 8: File System Editor.
·
In
the Add Project Output Group box, select
DepWebProject from the Project list as shown in the
Figure 9.

Figure 9: Add Project Output Group box and
Setting VirtualDirectory in Web Application
Properties Window
The
Add Project Output Group dialog box indicates which
outputs of projects in the current solution will be
incorporated to an installer or merge module. The
Outputs List contains a list of outputs for the
selected project. Multiple items may be selected in
the list. The following items are listed in the
Output list.
1.
Primary Output: Contains the DLL or EXE built by
the project.
2.
Localized resources: Contains the satellite
assemblies for each culture's resources.
3.
Debug Symbols: Contains the debugging files for
the project.
4.
Content Files: Contains all content files in the
project.
5.
Source Files: Contains all source files in the
project.
·
To
add the content files and the compiled assemblies
and their dependiceis to the compiled Windows
Installer program (.msi file), select the Primary
Output and Content Files groups from the list and
click OK.
·
In
the File System Editor, click the Web Application
folder. In the Properties box, set the
DefaultDocument property to WebForm1.aspx and set
the VirtualDirectory property to DepWebProject as
shown in the Figure 9. Based on this information
Windows Installer creates a virtual directory under
the Default Web Site of the target server and set
its default document property.
·
On
the Build menu, click Build WebSetup1to create a
WebSetup1.msi Windows Installer setup file.
·
Copy the WebSetup1.msi file to the target Web server
computer and double-click the file to run the
installer. The Figure 10 shows the initial setup
screen in a target Web server computer while running
the WebSetup1.msi.

Figure 10: Initial WebSetup1 Setup Wizard
In
the above method we employ Web Setup Project to
deploying a Web application. In that method it will
create only a blank installation project and we have
to select the tasks and the necessary files to be
included in the installer. If you are a beginner,
you can employ Setup Wizard which is simple and it
helps you step-by-step to create a setup project
with fewer straightforward questions. The Figure 11
shows the Setup Wizard Dialog Box.

Figure 11:
Setup Wizard Dialog Box