由于不良的卸载,InstallShield失败 [英] InstallShield fails because of a bad uninstall

查看:172
本文介绍了由于不良的卸载,InstallShield失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个InstallShield项目,该项目会对现有安装进行[重大升级] [1](即,我在保留Upgrade Code的同时更改了Product Code).

I'm building an InstallShield project, which does a [Major Upgrade][1] to an existing install (i.e. I changed the Product Code while retaining the Upgrade Code).

先前版本(已部署)的卸载程序已损坏,无法运行某些脚本.这本身不是一个严重的问题,因为所有相关文件都已事先删除.

The uninstaller of the previous version (which is already deployed) is broken, and fails to run some scripts. This in itself is not a serious problem, as all relevant files are removed beforehand.

问题在于,当新安装程序尝试卸载以前的版本时,它将在卸载程序失败时中止.我尝试设置失败时继续"标志(媒体"->升级"->主要升级"->高级"->其他设置"),但没有效果.

The problem is that when the new installer attempts to uninstall the previous version, it aborts when the uninstaller fails. I've tried setting the 'Continue On Failure' flag (Media-->Upgrades-->MajorUpgrade-->Advanced-->Additional Settings), but with no effect.

问题:

  • 是否可以将IS配置为以静默方式删除以前的版本?
  • 如果没有,我可以编写一些自定义VB操作来静默卸载以前的版本吗?

编辑

不确定是否相关,但这是以前的卸载程序存在的问题:

Not sure this is relevant, but here is what is wrong with the previous uninstaller:

安装顺序包括一些自定义操作.其中两个调用可执行文件,这些可执行文件又安装了一些设备驱动程序.显然,它们仅应在安装过程中运行.不幸的是,以前的设计者没有设置'NOT REMOVE'条件,这导致操作在卸载操作期间运行.因此,卸载程序将失败(因为找不到驱动程序可执行文件).

The Installation sequence includes some custom actions. Two of these call executables which in turn install some device drivers. Obviously, they should only run when an installation is underway. Unfortunately, the previous designer did not set the 'NOT REMOVE' condition, which causes the actions to run during an uninstall operation. Thus the uninstaller fails (as it cannot find the driver executables).

推荐答案

这不是评论,而是答案,但是评论太长了.

This is more of a comment than an answer, but it became too long for a comment.

通常真正的解决方法是创建一个次要升级(或次要升级补丁)以修复"卸载顺序中的错误,然后再进行卸载产品(无论是主要升级卸载还是手动触发的卸载,都可以使用).这是可能的,因为较小的升级不会卸载现有产品(失败的卸载自定义操作将永远不会运行),而只会就地"更新产品(或覆盖产品).这样一来,您就可以在调用卸载顺序之前解决所有错误.

Generally the real fix is to create a minor upgrade (or a minor upgrade patch) to "hotfix" the error in the uninstall sequence and then uninstall the product the normal way (will work regardless if it is a major upgrade uninstall or a manually triggered uninstall). This is possible because a minor upgrade doesn't uninstall the existing product (the failing uninstall custom actions will never run), but just updates the product "in place" (or overwrites it). This allows you to fix whatever was wrong in the uninstall sequence before it is called.

我已经成功地多次使用此方法来修复公司软件包中的严重错误,这些软件包可能有很多已安装的实例,并且卸载顺序失败了.但是,这并不是一件容易的事-这将需要时间和测试工作.我通常也以补丁程序的形式提供此更新,但是较小的升级就足够了(补丁程序很复杂).

I have successfully used this approach many times to fix critical errors in corporate packages that may have a lot of installed instances and the uninstall sequence is failing miserably. However, it is not exactly a trivial thing to do - it will take time and testing effort. I generally deliver the update as a patch as well, but a minor upgrade should suffice (patching is complicated).

次要升级软件包的最简单方法可能是设置一个条件,该条件对于所有失败的卸载自定义操作都始终为false,从而使它们永远不会运行实际触发卸载后.显然,这会在盒子上留下一些垃圾",但是您可以忽略它,或者更好地清理它.但是,请谨慎使用清理代码-它倾向于包含新的错误,然后您必须在适当的时候对其进行处理.部署是一个过程,在此过程中,每个增加的发行周期,错误修复和调整都会为意外错误打开新的可能性,然后为下一个发行版增加新的复杂性和不可预测性.使事情尽可能简单.简而言之:只有更多可以破裂而不增加任何收益的东西.如果没有问题,一定要清理.

The easiest approach for your minor upgrade package is probably to set a condition that will always be false on all failing uninstall custom actions so that they never run once uninstall is actually triggered. This will obviously leave "some junk" on the box, but you may be able to ignore that or better yet clean it up. Be careful with cleanup code though - it tends to include new bugs that you then have to deal with in due course. Deployment is a process where each added release cycle, bug fix and tweak opens up new possibilities for unexpected errors that then add new complexity and unpredictability for the next release. Keep things as simple as possible. Simply put: just more stuff that can break without adding any benefit. Definitely clean things up if there are operational problems if you don't.

关于如何实施次要升级,我不会太详细. Installshield帮助文件在此主题上非常出色,应该可以帮助您完成工作.我将进行一个更新,除了更改卸载操作的条件外,别无其他选择.

I won't get into too much detail with regards to how a minor upgrade should be implemented. The Installshield help file is quite good on this topic and should help you get things done. I would make an update that does nothing other than change the conditions on the uninstall actions.

一旦进行了次要升级,则需要使用适当的命令行来应用它,或者仅使用Installshield的setup.exe为您执行此操作.再次查看Installshield帮助文件("小型升级的运行时行为" -此帮助页面应为您所需要的全部.)

Once you have a minor upgrade, you need to apply it using the appropriate command line OR just use Installshield's setup.exe to do this for you. Again see the Installshield help file ("Run-Time Behavior for Minor Upgrades" - this help page should be all you need).

在不使用setup.exe包装程序的情况下进行较小升级的命令行通常为:

The command line to apply a minor upgrade without a setup.exe wrapper is generally:

msiexec.exe /i product.msi REINSTALLMODE=vomus REINSTALL=ALL

如果通过不带setup.exe包装程序的msiexec.exe手动安装,则为REINSTALLMODE添加the v option非常重要.这会将新的MSI缓存在系统上,这对于小规模升级能否正常运行至关重要,尤其是对于修复卸载顺序的目的.

Adding the v option for REINSTALLMODE is very important if you install manually via msiexec.exe without a setup.exe wrapper. This caches the new MSI on the system, and is crucial for minor upgrades to work correctly - in particular for your purpose of fixing the uninstall sequence.

查看全文

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