我如何说服VS2005微星升级? [英] How do I persuade a VS2005 msi to upgrade?

查看:197
本文介绍了我如何说服VS2005微星升级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用VS2005用C#编写Windows服务。

I have a Windows service written in C# using VS2005.

安装是通过调用MSIEXEC安装MSI文件使用VS2005也创造了一个向导。

The installation is via a wizard that calls msiexec to install the msi file also created using VS2005.

我无法生成将来自服务的一个版本升级到另一个版本的MSI文件。该向导程序处理当前安装版本的检测,停止服务,想出一个适当的命令行MSIEXEC,然后重新启动该服务。

I am having trouble generating an msi file that will upgrade from one version of the service to another. The wizard program handles detection of the currently installed version, stopping the service, coming up with an appropriate command-line for msiexec and then re-starting the service.

现有微星的1.1.02版本属性,则新的1.1.03。该产品和升级代码是相同的。

The existing msi has a version property of 1.1.02, the new one is 1.1.03. The product and upgrade codes are identical.

手动卸载1.1.02通过添加/删除程序工作正常,一样安装到1.1.03一个干净的系统。

Uninstalling 1.1.02 manually via add/remove programs works fine, as does installing 1.1.03 onto a "clean" system.

升级1.1.02到1.1.03去走过场,但最终的结果是安装1.1.02。

Upgrading 1.1.02 to 1.1.03 goes through the motions but the end result is 1.1.02 installed.

该向导将使用升级的命令行是:

The command line that the wizard uses for upgrading is:

MSIEXEC / QB / IMyProduct.msi安装=ALL重建=VOS

msiexec /qb /i "MyProduct.msi" REINSTALL="ALL" REINSTALLMODE="vos"

我在哪里去了?我猜想我一定是错过了一些相当基本...

Where am I going wrong? I'm assuming I must have missed something fairly fundamental...

秋季后卫的位置是在运行之前通知用户,他们需要手动卸载1.1.02 。向导安装1.1.03,但我宁愿没有这样做。

The fall-back position is to inform customers that they need to manually uninstall 1.1.02 before running the wizard to install 1.1.03 but I'd rather not have to do that.

编辑补充:

更改产品代码(如VS2005也提示你)实际上消除在所有升级的能力,因为它如果以前没有安装该产品代码安装程序不会让你做一个重新安装。

Changing the product code (as VS2005 also prompts you to) actually removes the ability to upgrade at all, as it the installer won't let you do a reinstall if that product code hasn't previously been installed.

所有它就会让你做的就是安装(然后你会得到一贯的服务已经存在型消息)。

All it will then let you do is install (and then you get the usual "service already exists" -type message).

推荐答案

有需要做才能得到几件事情升级与微星的,如果你想自动删除以前的版本工作。

There are several things that need to be done to get "upgrades" to work with MSI's if you want to automatically remove the previous version.

首先关于神秘的代码的一些背景资料。有3码(GUID的)与MSI相关的:

First some background information about the mysterious "codes". There are 3 codes (GUID's) associated with an MSI:


  1. 封装代码 - 该标识的特定版本MSI安装程序和不应该被重复使用跨构建。它必须总是进行更新。

  2. 产品代码 - 这个标识符用来标识的应用程序的特定版本。它是由安装程序的作者决定何时分配一个新的产品代码

  3. 升级代码 - 这个标识应用程序,不应该改变通过它的生命周期

  1. Package Code - This identifies a particular version of the MSI installer and should never be reused across builds. It must always be updated.
  2. Product Code - This identifier is used to ID a particular version of the application. It is up to the installer author to decide when to assign a new product code.
  3. Upgrade Code - This identifies the application and should not change through it's lifetime

升级代码的应该永远不会改变。对于升级之情况,产品代码必须改变每个版本。此外,正如你提到的,你必须碰到的版本号。在产品代码的和的升级代码的,可以通过选择安装项目和去属性窗口中。在封装代码的是隐藏在工作室,将永远被更新。

The Upgrade Code should never change. For you upgrade scenerio, the Product Code must be changed for each version. Additionally, as you mentioned, you must bump the version number. The Product Code and Upgrade Code can be found by selecting your setup project and going to the Properties Window. The Package Code is hidden in Studio and will always be updated.

你可能缺少的项目,就是你还需要设置RemovePreviousVersions在属性窗口中设置的真正

The item you are probably missing, is that you also need to set the RemovePreviousVersions setting in the Properties Window to true.

这篇关于我如何说服VS2005微星升级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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