DESKTOP

Visual Basic 2010 : Setup & Deployment Projects for Windows Installer (part 1) - Creating a Setup Project

1/6/2013 6:09:29 PM

1. Windows Installer Overview

Windows Installer is the Microsoft technology for deploying applications. This technology has been part of the Windows operating system for many years and can be considered as an engine for installing .Msi packages. An .Msi package, or installer package, contains all files to be installed with your application and other important information such as shortcuts, icons, license agreements, other redistributable packages, and key/values to be written to the Windows Registry.

Windows Installer is the most powerful technology for deploying .NET applications with Visual Studio 2010. This is because Windows Installer has few limitations, whereas it brings lots of benefits. Windows Installer makes it difficult to provide updates, so if you plan to release frequent updates for your applications, you should consider ClickOnce. You should choose Windows Installer as the deployment system for your application if you meet one or more of the following requirements:

  • Adding values to the Windows Registry

  • Customizing installation folders

  • Installing assemblies to the Global Assembly Cache or installing and registering COM components

  • Installing Windows services and peripheral drivers

  • Executing custom actions and specifying launch conditions

  • Managing ODBC components

  • Creating custom shortcuts in the Windows user interface

  • Elevated permissions and deeper interaction with the user

In scenarios different from the ones listed, you might instead consider ClickOnce. Visual Studio 2010 is the perfect environment for creating projects that can build Windows Installer packages that install your applications on target machines the most appropriate way. In next section you see how to accomplish this.

2. Creating a Setup Project

First, create a new WPF project with Visual Basic and name it DeploymentDemo. This project just serves as the demo application to be deployed. When the new project is ready, right-click the solution name in Solution Explorer and then select Add, New Project. In the New Project dialog select the Other Project Types, Setup and Deployment, Visual Studio Installer templates subfolder and then choose the Setup Wizard project template, as shown in Figure 1. Name the new project SetupExample and then click OK.

Figure 1. Adding a new setup project to the solution.

The Setup Wizard is the most common project template for generating setup procedures for Windows Installer because it simplifies the process of packaging the output of other projects in the current solution through a number of guided steps.

Note

The Setup Project and the CAB Project templates enable, respectively, creating an empty project for creating a Windows Installer package and creating an empty project for packaging the application into CAB archives. The Merge Module Project is used to create a merge module that is basically an additional component for Windows Installer packages and that contains redistributable packages generally storing libraries and components. Finally the Web Setup Project is useful for deploying web applications.


When you click OK, the Setup Wizard will be launched. The first dialog is just a welcome one so click Next. The second dialog requires you to specify the project type. Leave unchanged the default selection for a Windows application, as shown in Figure 2, and then click Next.

Figure 2. Choosing the installer project type.

The third dialog is important because it enables selecting the content of your package. Although you can perform this later, this is the best place for adding contents. You must select the Primary Output option, as demonstrated in Figure 3, to include the application’s executable and its dependencies.

Figure 3. Adding the primary output to the setup project.

When you click Next you go ahead to the fourth dialog that enables specifying additional files to be packaged. Because this is not our case, click Next again. The fifth and last dialog contains a summary report for the new project, as shown in Figure 4.

Figure 4. The summary report provided before the project generation.

If you missed something you can step back to the previous dialogs. Now click Finish so that Visual Studio generates the setup project for you. The new project is now available in Solution Explorer and is almost ready to be built for deployment. To make the deployment the most accurate possible, you can perform some customizations, which are discussed in next section.

Other  
 
Top 10
Review : Sigma 24mm f/1.4 DG HSM Art
Review : Canon EF11-24mm f/4L USM
Review : Creative Sound Blaster Roar 2
Review : Philips Fidelio M2L
Review : Alienware 17 - Dell's Alienware laptops
Review Smartwatch : Wellograph
Review : Xiaomi Redmi 2
Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
REVIEW
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
Popular Tags
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Exchange Server Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe Photoshop CorelDRAW X5 CorelDraw 10 windows Phone 7 windows Phone 8 Iphone