How To: Implement a Major Upgrade In Your Installer
When creating an .msi-based installer, you are strongly encouraged to include logic that supports Windows Installer major upgrades. Major upgrades are the most common form of updates for .msi's, and including support in your initial .msi release gives you flexibility in the future. Without including support for major upgrades you risk greatly complicating your distribution story if you ever need to release updates later on.
You can use the following steps to enable major upgrades in your .msi, build multiple versions of your .msi and test major upgrade scenarios.
Step 1: Add upgrade information needed to cause new versions to upgrade older versions
In order to allow major upgrades, you must include the following information in your .msi:
Add a unique ID to identify that the product can be upgraded
To accomplish this, you must include an UpgradeCode attribute in your Product element. This looks like the following:
<ProductId="*"
UpgradeCode="PUT-GUID-HERE"
Name="My Application Name"
Language=""
Version="1.0.1"
Manufacturer="My Manufacturer Name"/>
Schedule the removal of old versions and handle out-of-order installations
The MajorUpgrade element upgrades all older versions of the .msi. By default, it prevents out-of-order installations: installing an older version after installing a newer version.
<MajorUpgrade
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit.">
There are several options for where you can schedule the RemoveExistingProducts action to remove old versions of the .msi. You need to review the options and choose the one that makes the most sense for your scenarios. You can find a summary of the options in the RemoveExistingProducts documentation.
By default, MajorUpgrade schedules RemoveExistingProducts after InstallValidate. You can change the scheduling using the Schedule attribute. For example, If you choose to schedule it after InstallInitialize, it will look like the following:
<MajorUpgrade
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit.">
Windows Installer looks for other installed .msi files with the same UpgradeCode value during the FindRelatedProducts action. If you do not specifically schedule the FindRelatedProducts action in your setup authoring, WiX will automatically schedule it for you when it creates your .msi.
Step 2: Build version 1 and version 2 of your .msi
Creating version 1 of your .msi is as simple as running your standard build process - this means you compile and link it with the WiX toolset. In order to create version 2 of your .msi, you must make the following changes to your setup authoring, then re-run your build process to create a new .msi:
- Increment the Version value in your Product element to be higher than any previous versions that you have shipped. Windows Installer only uses the first 3 parts of the version in upgrade scenarios, so make sure to increment your version such that one of the first 3 parts is higher than any previously shipped version. For example, if your version 1 uses Version value 1.0.1.0, then version 2 should have a Version value of 1.0.2.0 or higher (1.0.1.1 will not work here).
- Generate a new Id value in the Product element of the new version of the .msi.
Step 3: Test upgrade scenarios before you ship version 1
This step is very important and is too often ignored. In order to make sure that upgrade scenarios will behave the way you expect, you should test upgrades before you ship the first version of your .msi. There are some upgrade-related bugs that can be fixed purely by making fixes in version 2 or higher of your .msi, but there are some bugs that affect the uninstall of version 1 that must be fixed before you ship version 1. Once version 1 ships, you are essentially locked into the uninstall behavior that you ship with version 1, and that impacts major upgrade scenarios because Windows Installer performs an uninstall of version 1 behind the scenes during version 2 installation.
Here are some interesting scenarios to test:
- Install version 1, then install version 2. Make sure that version 1 is correctly removed and version 2 functions correctly. Make sure version 2 cleanly uninstalls afterwards.
- Install version 2, then try to install version 1. Make sure that version 1 correctly detects that version 2 is already installed and either blocks or silently exits, depending on what behavior you choose to implement for your out-of-order installation scenarios.
When testing major upgrade scenarios, make sure to pay particular attention to the conditions on custom actions in your .msi because you may run into issues caused by custom actions running during a major upgrade uninstall and leaving your product in a partially installed state. The UPGRADINGPRODUCTCODE property can be useful to prevent actions from running during an uninstall that is invoked by the RemoveExistingProducts action.
In addition, pay attention to assemblies that need to be installed to the GAC or the Win32 WinSxS store. There is some information about a sequence of events that can remove assemblies from the GAC and the WinSxS store during some major upgrades in this knowledge base article.
from:http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html
How To: Implement a Major Upgrade In Your Installer的更多相关文章
- From MSI to WiX, Part 8 - Major Upgrade, by Alex Shevchuk
Following content is reprinted from here, please go to the original website for more information. Au ...
- Installshield Major upgrade
Major upagrade: delete old version firstly, then install new version. need to change [product code] ...
- What are the differences between small, minor, and major updates?
Following contents are excerpted from the this website and only used for knowledge sharing: Install ...
- C++ Core Guidelines
C++ Core Guidelines September 9, 2015 Editors: Bjarne Stroustrup Herb Sutter This document is a very ...
- YARN(MapReduce 2)运行MapReduce的过程-源码分析
这是我的分析,当然查阅书籍和网络.如有什么不对的,请各位批评指正.以下的类有的并不完全,只列出重要的方法. 如要转载,请注上作者以及出处. 一.源码阅读环境 需要安装jdk1.7.0版本及其以上版本, ...
- an alternative to symmetric multiprocessing
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION 17.5 CLUSTERSAn impor ...
- Installshield 打包安装包心得
制作简单的安装软件 声明:下面的教程,是把读者当做完全没接触过IS的角度来制作的. 1. 启动InstallShield 12.建立一个InstallShield MSI Project,如图: 2 ...
- VMWare Workstation 10.0 Preview CN
What's New in the VMware Workstation Technology Preview July 2013 The VMware Workstation team is exc ...
- Docker Resources
Menu Main Resources Books Websites Documents Archives Community Blogs Personal Blogs Videos Related ...
随机推荐
- mongodb导入json文件
mongoimport --db test --collection item --jsonArray item.json
- 004_on-my-zsh漂亮的shell
一. http://www.cnblogs.com/GarveyCalvin/p/4301235.html 二. 前言:Zsh可配置性强,用户可以自定义配置,个性化强.Zsh tab补全更强大,该功能 ...
- InteliJ IDEA 简单使用:配置项目所需jdk
1:配置项目所需jdk: File->Project Structure 弹出如下界面: 首先选中SDKs,会出现下图界面:点击“+”标志弹出Add New SDK 然后选择JDK,会弹出路径框 ...
- JavaEE-案例1-网站信息展示
案例1-网站信息展示 需求: 在页面上展示一些文字信息,需要排版. 技术分析: html:超文本 标签 语言 作用:展示 超文本:超越了一般文本,描述文本的字体.颜色.图片 标签:标记 html书写规 ...
- ZOJ 3203 灯泡
题面 相比 wildleopard 的家,他的弟弟 mildleopard 比较穷.他的房子是狭窄的而且在他的房间里面仅有一个灯泡.每天晚上,他徘徊在自己狭小的房子里,思考如何赚更多的钱.有一天,他发 ...
- k8s集群master节点上的flannel总是不定期重启的原因分析
这个问题,困绕了团队一段时间, 因为暂时没有用到master的外网网络, 没有引起重视,但总归要解决. 上周五,刚好有点小空,就深入调查了一下. 最后,定位到了问题点:k8s master节点的fla ...
- #JS attr和prop的区别
HTML元素固有属性:使用prop方法 HTML元素自定义属性:使用attr方法
- PHP rabbitmq扩展安装
转载自: https://www.jianshu.com/p/65490900a937 安装rabbitmq的php扩展 1.安装扩展依赖库##### 注意:扩展是C写的,由于C与RabbitMQ通信 ...
- P1020 导弹拦截 dp 树状数组维护最长升序列
题目描述 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度.某天,雷达捕捉到敌国的导弹 ...
- Django 2.1版本与Django 1.8.3的一些区别(转)
Django 2.1版本与Django 1.8.3的一些区别 我在刚开始学习的时候使用的Django版本是1.8.3的,后来在安装其它软件的时候,可能需要2.1的版本,自动帮我更新了Djang ...