Following content is reprinted from here, please go to the original website for more information.

Author:  pusu

Recently I am working with Windows Installer and think ProductCode, UpgradeCode and PackageCode are very basic but very important concepts, so I make a conclusion here for references. Both ProductCode and UpgradeCode can be viewed from Property table in MSI package, and PackageCode can be reviewed from View->Summary information if you view MSI through Orca (which is shipped with Windows SDK.)

What is UpgradeCode in the MSI package?

The upgrade code is the unique GUID of identifying a family of a product. That is, the same products with different versions have probably been shipped for a few releases. These products have different ProductCodes, but they are linked together by using SAME UpgradeCode. For example, assuming that we wrote a product called "Happy MSI" and this product only has one MSI package for deployment on client system. The first release of this product is actually the MSI package with name "version_1.msi", and the second release is "version_2.msi". Then, these two MSI must have same UpgradeCode. When users run "version_2.msi" on their system, the windows installer will use the UpgradeCode to decide if previous versions of this product are already present on the system. Installer API "MsiEnumRelatedProducts()" uses the UpgradeCode to query all the family products.

What is ProductCode in MSI Package?

The product code is the unique GUID of identifying an application or product release; In other words, different versions and languages of Product must have different product codes. http://msdn.microsoft.com/en-us/library/aa370854(VS.85).aspx. Also, ProductCode can be used to query feature state, and product state. For example,  installer API "MsiQueryFeatureStateEx()" and "MsiQueryProductState()", etc.

What is PackageCode in MSI Package?

Similar, the package code is the unique GUID identifying a particular Windows Installer package. Here, package mapps to a physical file with extension name ".MSI". Remember, a product consists of one or multiple (MSI) packages, and one package also can be shared among different products. The combination of ProductCode and PackageCode is used to determine if the users want to reinstall the product or not. I found the book "The Definitive Guide to Windows Installer" has the best explaination on this. There are four scenarios:

  • If you install same product (same ProductCode) from the same package (same PackageCode), it means you want to go to "repair" or "uninstall" mode.
  • If you install same product (same ProductCode) from the different package (different PackageCode), it is not allowed. You willl get message "Another version of this product is already installed", and you have to remove the existing installed product before you install the new one.
  • If you install different product (different ProductCode) from the package (same PackageCode), it would go into maintenance mode and ask for a repair or remove.
  • If you install different product (different ProductCode) from the package (different PackageCode), the installer will think it is a NEW product and let you go ahead.

最新文章

  1. C#简单的对象交互
  2. 树形DP
  3. 使用js进行string和json之间转换的方法
  4. mysql入门语句10条
  5. SQL脚本书写的几点建议
  6. MongoDB 学习笔记(三)—— 修改器的使用
  7. hdoj 1596 find the safest road
  8. Python闭包与函数对象
  9. func 和action 委托的使用
  10. Winform Focus()函数不起作用 解决办法
  11. iOS TouchID & FaceID
  12. Codeforces 408D Long Path (DP)
  13. 项目实战03:Keepalived 实现高可用
  14. ESLint 配置说明
  15. Asp.Net T4模板生成三层架构
  16. 翻译:Bing地图瓦片体系
  17. java io 处理流,BufferdInputStream、BufferedWriter、BufferedReader
  18. mySQL 多表查询语句
  19. django 查询集 API
  20. [USACO5.1]夜空繁星Starry Night

热门文章

  1. C# WinForm 上传图片,文件到服务器的方法Uploader.ashx
  2. Android - FrameLayout覆盖顺序
  3. ORACLE中CONSTRAINT的四对属性
  4. sqoop的安装与使用
  5. [Javascript] Other functor
  6. mysql并发复制系列 一:binlog组提交
  7. VMware 9 安装 OS X 10.8.4 并安装 Xcode 4.6
  8. 操作cookie
  9. 03 InnoDB锁问题
  10. js中将字符串转换成json的方式