Installshield:自定义操作以卸载先前版本并安装最新版本 [英] Installshield : custom action to uninstall previous version and install the latest version

查看:622
本文介绍了Installshield:自定义操作以卸载先前版本并安装最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求如下:


  1. 如果应用程序版本为12.0安装在 C:\Folder1 上,版本13.0的安装程序将安装在文件夹 C:\Folder1 ,则版本13.0的安装程序应静默卸载12.0版本并安装最新版本13.0

  1. If an application with version e.g. 12.0 is installed at C:\Folder1 and a setup with version 13.0 is to be installed in the folder C:\Folder1 then the setup of version 13.0 should uninstall 12.0 version silently and install the latest version 13.0

如果应用程序的版本为例如12.0安装在 C:\Folder1 上,版本13.0的安装程序将安装在文件夹 C:\Folder200 ,则版本13.0的安装程序应安装最新版本并保留版本12.0

If an application with version e.g. 12.0 is installed at C:\Folder1 and a setup with version 13.0 is to be installed in the folder C:\Folder200 then the setup of version 13.0 should install the latest version and also retain the version 12.0

我拥有的东西尝试过:


  1. 如果我使用升级代码方法来卸载以前的版本,那么即使以前的版本安装在系统上的任何位置。

  1. If I use the upgrade code method to uninstall the previous version then the uninstall of previous versions will happen even if the previous version is installed anywhere on the system.

使用自定义操作-创建一个vbscript来使用WindowsInstaller.Products数据和所创建的Product代码读取已安装的产品使用 msiexec.exe / x ProductCode卸载应用程序的命令

Using custom action - create a vbscript to read the installed products using WindowsInstaller.Products data and using the Product code created a command to uninstall the application using "msiexec.exe /x ProductCode"


  • 在文件传输之前部分添加此自定义操作在install shield项目中,弹出窗口显示应用程序正在安装该版本,并等待其完成该过程。

  • 自定义操作的等待操作属性设置为是。

  • 我尝试将其设置为否,并且仍然出现相同的弹出窗口。

  • 如果我在安装完成后,在install shield项目中完成成功对话框,然后安装两个版本,并且在执行vbscript之后,它会卸载以前的版本。
    这种方法的问题是,当我双击应用程序的桌面图标时;它开始安装并显示安装进度的弹出窗口。这会使客户感到困惑。
    因此这种方法不适合。

  • This custom action when added in the "Before File Transfer" section in install shield project, gives a pop-up that "The application is installing the version and to wait till it has completed the process".
  • The "Wait for Action" property for the custom action is set to Yes.
  • I tried setting it to "No" as well still same pop-up appears.
  • If I add the custom action in the section of "After setup complete Success Dialog" in install shield project, then both versions are installed and after the vbscript executes, it does uninstall the previous version. The problem with this approach is, when I double click on the desktop icon of the application; it starts installing and displays pop-up of the progress of installation. This would be confusing for the customer. So this approach is not suitable.

我们尚未在注册表中添加任何数据,因此无法使用注册表卸载以前版本的方法。

We have not added any data in registry so cannot use the registry method to uninstall previous versions.

这是任何软件的基本要求,但我无法了解如何实现这一目标。请让我知道是否有人指出。

This is a very basic requirement for any software, but I am not able to make out how to achieve this. Please let me know if anybody has some pointers.

我有Installshield限量版2015和Visual Studio 2015 Professional。

I have Installshield limited edition 2015 and Visual Studio 2015 Professional.

推荐答案

恐怕MSI不能很好地适应这种情况-正如您所发现的。

I am afraid MSI does not lend itself too well to this sort of scenario - as you have discovered.


  • 这是公司软件,还是用于一般的大规模发行

  • 这种多实例方法的目的是什么?该MSI是否有效地安装了同一应用程序的两个不同版本?

  • Is this a corporate software, or is it for general, large-scale distribution?
  • What is the purpose of this multi-instancse approach? Does this MSI effectively install two different versions of the same application?

实例转换 :我想您可以调查 实例转换 概念。它打算允许多个安装,但是我不喜欢这个概念,并且从未积极使用它。因此,我无法为您提供局限性和陷阱的内幕消息-对不起-也许其他人可以阐明?

Instance Transforms: I suppose you could investigate the instance transforms concept. It is intended to allow multiple installations, but I dislike the concept and have never used it actively. I am hence not able to give you the inside story of limitations and gotchas - sorry - maybe someone else can illuminate?

PhilDW指出您可以使用其他升级代码最新的MSI,然后与旧安装并排安装。除了已经提到的内容,您还需要更改新软件包的所有组件GUID。 WiX允许根据目标路径自动生成组件GUID,但对于Installshield则不然。 实例转换 应该可以并排安装而无需更改所有组件GUID-我相信。

As PhilDW states you can use another upgrade code for the newest MSI, and then install side-by-side with the old installation. Beyond what has already been mentioned you would also need to change all component GUIDs for the new package. WiX allows component GUIDs to be auto-generated based on destination path, but not so for Installshield. The instance transform should be possible to use to install side-by-side without changing all component GUIDs - I believe.

App-V :如果您处于公司环境中,并且有足够的经验,我还建议您检查App-V包装(虚拟化)。这样可以隔离应用程序,以便多个版本可以并行运行。但是,我再也不是给你内部故事的合适人选。我知道有很多限制,但是不能根据实际经验来详细说明。

App-V: If you are in a corporate setting, and if I had enough experience, I would also recommend that you check out App-V packaging (virtualization). This allows isolation of applications so multiple versions can run side-by-side. But again, I am not the right guy to give you the inside story. I know there are a number of limitations, but can't elaborate with real-world experience.

Setup.exe启动器 :如果您的应用程序可以正常处理多个实例而不会发生快捷方式和服务名称等冲突(如Phil描述的那样),那么您可以并排安装所有新版本,并且从不通过升级表默认情况下卸载旧版本。然后,您可以在 setup.exe 启动器(如果有)中手动处理以前版本的卸载。我想您可以使用实例转换概念来安装新版本,或者可以使用所有新组件GUID以及产品,打包和升级GUID为每个新版本重新创建安装程序。

Setup.exe Launcher: If your application gracefully handles multiple instances without clashing shortcuts and service name etc... (like Phil describes), then you could install all new versions side-by-side and never uninstall older versions by default via the upgrade table. You could then handle the uninstall of previous versions manually in your setup.exe launcher (if any). I suppose you could use the instance transform concept to install new versions, or you could re-create your setup for each new version with all new component GUIDs and product, package and upgrade GUIDs.

旧版Installscript项目 :我想您可以放弃MSI,而使用旧版Installscript项目来部署您的应用程序。我不建议这样做,因为这样的项目对于可靠的远程管理和静默运行(无论是安装还是卸载)都是有问题的。

Legacy Installscript Project: I suppose you could abandon MSI and use a legacy Installscript project to deploy your application. I would not recommend this since such projects are problematic for reliable remote management and silent running (both for install and uninstall).

某些维护链接:

  • WiX - Doing a major upgrade on a multi instance install
  • I want to install an MSI twice
  • Disable repair mode and upgrades in wix installer

这篇关于Installshield:自定义操作以卸载先前版本并安装最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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