如何安全删除旧的InnoSetup安装? [英] How can I safely remove old InnoSetup installations?

查看:102
本文介绍了如何安全删除旧的InnoSetup安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Delphi 6软件安装中使用InnoSetup 5.5.1(a).一位用户告诉我,如果未手动卸载,则旧的卸载条目会堆积在控制面板的删除程序"列表中.我正在考虑将安装更改为自动删除旧条目,但是我不想删除有效的旧条目.有些用户喜欢保留一两个旧版本,以防万一他们不喜欢新版本,或者担心新版本会破坏某些功能.

I use InnoSetup 5.5.1 (a) for my Delphi 6 software installations. A user just informed me that the old uninstall entries pile up in the Control Panel Remove Programs list if not uninstalled manually. I'm thinking of changing my install to remove old entries automatically but I don't want to remove old entries that are valid. Some users like to keep an old version or two around in case they don't like a later version or for fear a later version will break something.

为了清楚起见,我要特别指的是通常情况下用户通常会接受默认安装目录并覆盖现有版本的典型情况.但是,除了某些用户可以将一个或多个版本安装到另一个目录以保留它们之外,而大多数情况下都选择覆盖.我在删除旧版本时发现了这样的帖子:

For clarity's sake, I am referring specifically to the typical situation where a user usually accepts the default installation directory, overwriting the existing version. However, with the exception that some users may install one or more versions to a different directory just to preserve them, while choosing to overwrite most of the time. I found this SO post on removing old versions:

InnoSetup:如何自动卸载以前安装的版本?

但是在知道如何检测哪个旧版本是否多余时并没有提及.

But did not see any mention on knowing how to detect which of the old versions are superfluous or not.

因此,在安装过程中,如何自动从安装的程序列表中自动删除旧的卸载条目,而又不删除用户实际想要保留的任何内容?

Therefore, during an install, how can I automatically remove old uninstall entries automatically from the installed program list without removing any that the user actually wants to keep?

推荐答案

只要您在不同版本的应用程序中保持AppId相同,就永远只有一个添加/删除条目.用户运行安装程序的次数.这是典型应用程序的正常和推荐设计,在该应用程序中,用户只有一个副本,并希望使其保持最新状态.

As long as you keep your AppId the same between different versions of your application, there will only ever be one Add/Remove entry for it, no matter how many times the user runs the installer. This is the normal and recommended design for a typical application where the user only has one copy of it and wants to keep it up to date.

但是,如果用户在一个或多个以后的安装中选择了备用安装位置,则较旧的位置可能会变得孤立" —运行卸载将删除较新的副本,但将较旧的副本留在后面,没有添加/删除条目. (仍然可以通过手动运行卸载程序来将其卸载.)通常建议通过在[Setup]部分中包含以下选项来避免这种情况:

If, however, the user chooses alternate installation locations in one or more of the later installs, then it's possible for the older location to get "orphaned" -- running the uninstall will remove the newer copy but leave the older one behind, with no Add/Remove entry. (It will still be possible to uninstall it by running the uninstaller manually.) It's normally recommended to avoid this situation by including these options in your [Setup] section:

DisableDirPage=auto
DisableProgramGroupPage=auto

使用这些选项将使Inno跳过询问这些问题以进行升级安装的过程,这有助于防止用户意外制作孤立副本. (如果用户确实有意移动安装,他们仍然可以通过先卸载来进行安装.)

Using these options will make Inno skip asking these questions for an upgrade install, which helps to prevent the user accidentally making orphan copies. (If the user does intentionally want to move the installation, they can still do it by uninstalling first.)

请注意,我已经避开了您的问题,因为按照书面说明,这没有意义-如果有多个副本,则无法自动确定哪些是多余的",因为这纯粹是一个判断电话在用户方面.我在这里试图解释的是,您的设计应旨在阻止意外发生.

Note that I've sidestepped your question a bit, since as written it doesn't make sense -- if there are multiple copies, there's no possible way to automatically determine which are "superfluous", since that's purely a judgement call on the part of the user. What I've tried to explain here is that your design should aim to discourage this happening accidentally.

这篇关于如何安全删除旧的InnoSetup安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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