2007-05-10
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 1 of 2 )
When it's finally time to deploy your Windows-based .Net application, you have two choices: ClickOnce deployment and the traditional Windows Installer deployment. This article helps you chose the method that's right for your application and shows you the
Most Windows programs are installed using the traditional technique knows as a Windows Installer. You get the installation files on a CD or perhaps as a Web download, then you execute the setup program and a Wizard walks you through the installation procedure. This is one of the deployment methods supported by Visual Studio, and while it's reliable and popular it does present a few shortcomings that may be matters for concern in some scenarios.
To address these concerns, Microsoft developed another deployment technique called ClickOnce deployment. In a somewhat simplified nutshell, ClickOnce permits an application to be installed from a Web site or network share with essentially no user interaction. While ClickOnce addresses some of the concerns related to Windows Installer installation, it has its own limitations. Which deployment method is best for your application depends on a number of factors. We'll look at the procedures for each kind of deployment first, and then discuss the question of which one you should use.
Windows Installer Deployment
To create a Windows Installer for your project, you start by adding a setup project to your solution. With your project open:
- Select Add from the File menu, then select New Project.
- In the Add New Project dialog box, select the Setup and Deployment category.
- Select the Setup Project template.
- Specify a name for the deployment project. This is the name that will be displayed when the end-used runs the installation package.
- Click OK
An alternative that you may prefer is to select the Setup Wizard template in step 3. This opens a Wizard that walks you through the basics of defining your setup project.
Once you have added the setup project to your solution, there are two main aspects to completing the setup project. The first has to do with prerequisites, which are components that must be installed on the target system in order for your application to work. For almost all .Net applications this includes the .Net Framework, and may include other items such as Data Access Components, Crystal Reports, or Visual C++ libraries for x64 processors. Visual Studio is pretty good at detecting the prerequisites for a project but you may want to double check To do so:
- Select the setup project in the Project Explorer.
- Select Properties from the Project menu to open the property page for the project.
- Select Build under Configuration Properties.
- Click the Prerequisites button to open the Prerequisites dialog box.
Here you can select which prerequisites to include, and also select the install location for the prerequisites. You can remove prerequisites that Visual Studio selected, but only if you are 100% sure that it will already be present on all target systems.
Your second main task is to define what items will be added to the target machine's file system by the installation procedure. At a minimum you will want to add a shortcut for the program to the user's Start menu. Other things you can do include:
- Adding a shortcut to the desktop.
- Adding files, such as help and other support files, to the application folder.
- Adding fonts to the system Fonts folder.
- Adding an item to the user's Send To menu.
- Adding an item to the user's Startup folder.
After you have defined the setup project, all you have to do is build it and Visual Studio will create the Windows Installer package (an .MSI file) ready for you to distribute.
![]() |
|


