Microsoft KB Archive/827022

= HOW TO: Create a Major Upgrade Windows Installer Package by Using Visual Studio .NET =

PSS ID Number: 827022

Article Last Modified on 9/29/2003

-

The information in this article applies to:


 * Microsoft Visual Studio .NET (2003), Professional Edition
 * Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
 * Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
 * Microsoft Visual Studio .NET (2003), Academic Edition
 * Microsoft Visual Studio .NET (2003), Trial Edition
 * Microsoft Visual Studio .NET (2002), Professional Edition
 * Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
 * Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
 * Microsoft Visual Studio .NET (2002), Academic Edition
 * Microsoft Visual Studio .NET (2002), Trial Edition
 * Microsoft Windows Installer

-



IN THIS TASK

 * SUMMARY
 * Requirements
 * Create a Setup Project
 * Add a File, and Then Build Your Setup Project
 * Install the Original Version of Your Application
 * Create a Major Upgrade Windows Installer Package
 * Install the Updated Version of Your Application
 * REFERENCES



SUMMARY
This step-by-step article describes how to create a major upgrade Microsoft Windows Installer package by using Microsoft Visual Studio .NET.

The product code of an application is a globally unique identifier (GUID). The GUID is the principal feature that identifies the application. The product code of an application is stored in the ProductCode property of the Property table of the corresponding Windows Installer package. Before you make significant updates to an application, it is a good idea to change this product code.

A major upgrade of an application is a comprehensive update that warrants a new product code. For example, you may install an updated application without removing the original version of the application. In this scenario, it is a good idea to change the product code of the application, and then perform a major upgrade.

A minor upgrade of an application is an update that is sufficiently significant to warrant a new product version. However, a minor upgrade does not warrant a new product code. For example, you may install an updated application after you remove the original version of the application. In this scenario, it is a good idea to change the product version of the application, and then perform a minor upgrade.

back to the top

Requirements
The following list outlines the recommended hardware, software, network infrastructure, and service packs that you need:
 * Microsoft Windows 2000, Microsoft Windows XP, or Microsoft Windows Server 2003
 * Microsoft Visual Studio .NET

This article assumes that you are familiar with the following topics:
 * Visual Studio .NET Setup Projects
 * Patching and Upgrades

back to the top

Create a Setup Project

 * 1) Start Visual Studio .NET.
 * 2) On the File menu, point to New, and then click Project.
 * 3) Under Project Types, click Setup and Deployment Projects.
 * 4) Under Templates, click Setup Project.
 * 5) In the Name text box, type MyApp.
 * 6) Click OK.

back to the top

Add a File, and Then Build Your Setup Project
 Create a file that is named Readme.txt. To do this, follow these steps:  Start a text editor (such as Notepad). Type the following text in the text editor:

This is a readme file.

 On the File menu, click Save. In the Save As dialog box, locate the folder where you created the MyApp project in step 6 of the &quot;Create a Setup Project&quot; section of this article. In the File name text box, type Readme.txt . Click Save.</li></ol> </li> Switch to Visual Studio .NET.</li> On the Project menu, point to Add, and then click File.</li> In the Add Files dialog box, locate and then click the Readme.txt file that you created in step 1.</li> Click Open. The Readme.txt file is added to the MyApp project.</li> On the Build menu, click Build MyApp.</li></ol>

back to the top

Install the Original Version of Your Application

 * 1) Start Microsoft Windows Explorer.
 * 2) Locate the Setup.exe file that you built in step 6 of the &quot;Add a File, and Then Build Your Setup Project&quot; section of this article. The Setup.exe file is located in a folder that is named Debug. This Debug folder is located in the MyApp folder where you created the MyApp project in step 6 of the &quot;Create a Setup Project&quot; section of this article.
 * 3) Run the Setup.exe file.
 * 4) In the MyApp dialog box, click Next three times to start installing the MyApp application on your computer.
 * 5) On the Installation Complete page, click Close to quit your installation.
 * 6) In Windows Explorer, locate the folder where you installed the MyApp application. Notice that the Readme.txt file is located in this folder.
 * 7) Open the Readme.txt file. Notice that the Readme.txt file contains the text that you typed in step 1b of the &quot;Add a File, and Then Build Your Setup Project&quot; section of this article.

back to the top

Create a Major Upgrade Windows Installer Package

 * 1) Switch to Visual Studio .NET.
 * 2) In Solution Explorer, click MyApp.
 * 3) On the View menu, click Properties Window to select the Properties window for the MyApp project. Notice that the RemovePreviousVersions property is set to False. This setting indicates that the built Windows Installer package will not remove the original version of the MyApp application.
 * 4) Change the ProductName property to UpdatedMyApp.
 * 5) Change the Version property to 2.0.0 . A Microsoft Development Environment dialog box appears that contains the following text:It is recommended that the ProductCode and PackageCode be changed if you change the version. Do you want to do this?
 * 6) Click Yes to change both the product code and the package code of the MyApp application.
 * 7) On the Build menu, click Build MyApp.

back to the top

Install the Updated Version of Your Application

 * 1) Switch to Windows Explorer.
 * 2) Locate the Setup.exe file that you built in step 7 of the &quot;Create a Major Upgrade Windows Installer Package&quot; section of this article. The Setup.exe file is located in a folder that is named Debug. This Debug folder is located in the MyApp folder where you created the MyApp project in step 6 of the &quot;Create a Setup Project&quot; section of this article.
 * 3) Run the Setup.exe file.
 * 4) In the UpdatedMyApp dialog box, click Next three times to start installing the UpdatedMyApp application on your computer.
 * 5) On the Installation Complete page, click Close to quit your installation.
 * 6) In Windows Explorer, locate the folder where you installed the UpdatedMyApp application. Notice that the Readme.txt file is located in this folder.
 * 7) Open the Readme.txt file. Notice that the Readme.txt file contains the text that you typed in step 1b of the &quot;Add a File, and Then Build Your Setup Project&quot; section of this article.
 * 8) In Windows Explorer, try to locate the Readme.txt file that you noticed in step 6 of the &quot;Install the Original Version of Your Application&quot; section of this article. Notice that this file appears in the same folder where it appeared in step 6. This file location indicates that your major upgrade Windows Installer package did not remove the original version of the MyApp application.

back to the top

<div class="references_section">