Windows Installer 实例转换如何与升级交互? [英] How do Windows Installer instance transforms interact with upgrades?

查看:23
本文介绍了Windows Installer 实例转换如何与升级交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个安装包(通过 WIX),它利用实例转换允许在一台机器上多次安装.没有多想,我还添加了对重大升级的支持(就像我之前做过很多次一样).

今天第一次安装了新版本的产品,行为和我预期的不太一样:即使安装是针对新实例的,但似乎所有其他实例(都在一个旧版本)已被卸载.

事后看来,这并不特别令人惊讶,因为所有实例共享相同的升级代码.根据 FindRelatedProducts 的文档行动,那个和版本是确定哪些产品应该作为删除目标的唯一标准.

如何编写此安装包,以便在安装新版本时仅升级目标实例,其他实例不受影响?

我怀疑答案可能是我应该完全删除主要升级"功能,但我见过几个使用它的多实例安装示例,所以我不确定.此外,我发现我可能没有正确处理产品代码,因为它应该使用版本号进行更新,但实例转换使用固定的产品代码.不知何故,我不认为这是这里的问题,但我想我应该提一下以防万一.

解决方案

我曾经使用 InstallScript 编写了一个引导程序来支持类似的故事.这是在 InstallShield 包含此功能之前,基于我与他们共享的工作.

基本上我的代码做了很多工作来反映实例从 MSI 的存储中转换出来,然后查询 MSI API 以了解哪些实例已经安装以及当前 MSI 是否代表维护 UI(相同的 ProductCode 和相同的 PackageCode)或主要升级升级(不同的 ProductCode)或次要升级(相同的 ProductCode 不同的 PackageCode).

您可以在以下位置阅读更多详细信息:

多实例 MSI 和 InstallShield 12 >

这里解释了它在 IS2009+ 中的工作原理,并附有引导程序 UI 的屏幕截图.

InstallShield 2009 Beta 第一部分(多个实例)

I've created an installation package (via WIX) that takes advantage of instance transforms to allow itself to be installed multiple times on one machine. Without giving it a lot of thought, I also added support for major upgrades (as I had done many times previously).

Today, a new version of the product was installed for the first time, and the behavior was not quite what I expected: Even though the installation was targeted at a new instance, it appears that all the other instances (all at an older version) were uninstalled.

In hindsight, this was not particularly surprising because all instances share the same upgrade code. According to the documentation for the FindRelatedProducts action, that and the version are the only criteria for determining what products should be targeted for removal.

How can I author this installation package such that when a new version is installed, only the targeted instance is upgraded, and other instances are left alone?

I suspect the answer may be that I should remove the 'major upgrade' feature altogether, but I've seen several examples of multiple-instance installs that use it, so I'm not sure. Also, it occurs to me that I'm probably not handling the product code correctly because it should be updated with the version number, but the instance transforms use a fixed product code. Somehow I don't think that is the problem here, but I thought I should mention it just in case.

解决方案

I once wrote a bootstrapper using InstallScript to support a similar story. This was before InstallShield included this functionality and was based on my work that I shared with them.

Basically my code did a lot of work reflecting the instance transforms out of the MSI's Storage and then querying the MSI API to understand which instances were already installed and whether the current MSI represented a Maintenance UI ( same ProductCode and same PackageCode ) or a Major Upgrade Upgrade ( Different ProductCode ) or a Minor Upgrade ( same ProductCode different PackageCode).

You can read about it in more detail at:

Multiple Instance MSI's and InstallShield 12

Here's an explanation of how it works in IS2009+ with screen shots of the bootstrapper UI.

InstallShield 2009 Beta Part I ( Multiple Instances )

这篇关于Windows Installer 实例转换如何与升级交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆