Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 5 - Building an MSI File: Visual Studio and Or...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Building an MSI File: Visual Studio and Orca
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 27
    2004-10-12

    Table of Contents:
  • Building an MSI File: Visual Studio and Orca
  • Building a Package
  • A First Look at Shortcuts
  • More About Properties
  • GUIDs: Product, Upgrade, and Package Codes
  • Into the Package with Programming

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building an MSI File: Visual Studio and Orca - GUIDs: Product, Upgrade, and Package Codes


    (Page 5 of 6 )

    You can see in Figure 2-9 that the ProductCode property is in fact a GUID, a unique identifier made famous by its use in identifying COM classes and interfaces. It’s used here simply because it’s a convenient mechanism to identify the product uniquely. It’s in what is called the Registry format—text with curly braces around it. Windows uses the ProductCode property to identify this product uniquely, and the Windows Installer Service uses it to determine whether your product is already present on a system.

    The UpgradeCode is also a GUID that you should not change within the lifetime of a product. The idea behind UpgradeCode is that you will have major revisions to a product over time, and each of these revisions is intended as a replacement for the previous version. The UpgradeCode is the constant that links these revisions together. You can think of an UpgradeCode as defining a product family. Windows can detect whether a product containing a particular UpgradeCode has already been installed on a client system. It provides a mechanism to uninstall the prior version as you install the new version, so that the replacement is a seamless process instead of a visible uninstall followed by an install of the newer product. Each version replaces the prior version until a product arrives that is completely independent of the previous versions. In practice, this might be a marketing decision as much as a technical one. For example, each new version of Microsoft Office that comes out is a replacement for previous versions. However, if you look at the VS product line, VS.NET was the start of a different product line—it did not replace VS 6.0 but could be installed alongside it. If you were designing these product lines, the versions of Microsoft Office would all use the same UpgradeCode, but VS.NET would have a different UpgradeCode than VS 6.0. The way you build an installation to perform a major upgrade of a previous version is covered in Chapter 6.

    Each individual package—the MSI file—is also identified by a GUID—the PackageCode. This is used to distinguish between different builds of the same product. If you run Orca on an install package and choose Summary Information from the View menu, you see something like Figure 2-10. This shows the contents of the Summary Information stream for this package, and it includes the PackageCode. (You can also see a similar display when you choose Properties and Summary from the context menu when right-clicking a package, except that the PackageCode is reported there as Revision Number.)

    The combination of ProductCode and PackageCode is the way Windows knows what to do if you try to reinstall the product. If you install your Notepad package that you built in this chapter, then try to install the exact same package again, you see that it shows a maintenance mode dialog. In this Notepad installation, this means that the setup shows a dialog with choices for Repair or Remove. Windows knows that this product from this package is already installed on the system, and the package itself is designed to go into this maintenance mode if the product is already installed on the system. By definition, the fact that you are attempting to install the same product (same ProductCode) from the same package (PackageCode) means that you either want to repair or remove it. No other choices make sense in this context—the product is already installed, after all!

    You can change the PackageCode by altering the Revision Number from Explorer (right-clicking, choosing Properties and the Summary tab) or in the Orca view of the Summary Information, then closing and saving the file. When you attempt to install this package now, you see different behavior. This time there is a message box from Windows saying that “Another version of this product is already installed” and suggesting that you reconfigure from Add/Remove Programs. In other words, you have to configure or remove the existing installed product before you can install the new one. The PackageCode determines the initial behavior here. If you change only the ProductCode in the Property table using Orca and then try to install the package, it would go into maintenance mode and ask for a Repair or Remove. If you change the ProductCode and the PackageCode, Windows thinks it’s a totally new product and lets you go ahead with the installation.


     
    Figure 2-10.  MSI file summary information

    If you have built a genuinely new package containing new files, you’ve probably done so to have it update or replace the existing product on the system. This is the subject of Chapter 6. For now, the point of this exercise is to demonstrate the relationship between PackageCode and ProductCode. 

    This is from The Definitive Guide to Windows Installer, by Phil Wilson, (Apress, ISBN: 1590592972). Check it out at your favorite bookstore today. Buy this book now.

    More Visual Basic.NET Articles
    More By Apress Publishing


       · Hi,I've read this article :building msi file with visual studio and orca and...
     

    VISUAL BASIC.NET ARTICLES

    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET (F...
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT