如何从注册表卸载软件_为什么普通软件卸载无法从注册表中删除所有相关值?...

如何从注册表卸载软件_为什么普通软件卸载无法从注册表中删除所有相关值?...

如何从注册表卸载软件

如何从注册表卸载软件_为什么普通软件卸载无法从注册表中删除所有相关值?...

When you uninstall a program, it is a “reasonable” expectation that all traces of it will be removed from your system, but that is often not the case. Why is that? Today’s SuperUser Q&A post has the answers to a curious reader’s question.

卸载程序时,“合理”的期望是将其所有痕迹从您的系统中删除,但事实并非如此。 这是为什么? 今天的“超级用户问答”帖子回答了一个好奇的读者的问题。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Screenshot courtesy of wandersick (Flickr).

屏幕截图由wandersick(Flickr)提供

问题 (The Question)

SuperUser reader Mark Boulder wants to know why some registry values always remain after a normal software uninstall:

超级用户读者Mark Boulder想知道为什么在正常卸载软件后总是保留某些注册表值:

Expanding on the SuperUser topic How do I remove residual traces of uninstalled software from the registry, why is it that every time I uninstall a program and then later look it up via RegEdit, it is still there?

在SuperUser主题上扩展如何从注册表中删除已卸载软件的残留痕迹 ,为什么每次我卸载程序并随后通过RegEdit查找程序时,它仍然存在?

Why are the majority of Windows applications so intent on leaving tiny little traces of themselves in the registry? Does the fault lie with Windows or with the developers?

为什么大多数Windows应用程序都如此打算在注册表中留下很小的痕迹? 错误是Windows还是开发人员造成的?

Why are registry values usually “left behind” after normally uninstalling software?

为什么在正常卸载软件后,注册表值通常“被遗忘”?

答案 (The Answer)

SuperUser contributors Lukas Rieger and Keltari have the answer for us. First up, Lukas Rieger:

超级用户贡献者Lukas Rieger和Keltari为我们找到了答案。 首先,卢卡斯·里格(Lukas Rieger):

Because it is impossible. The registry has multiple root nodes but only two interesting ones: LocalMachine and CurrentUser. Normally, the setup writes values into LocalMachine, and the running program only writes into CurrentUser (actually, unless the setup messes with the permissions, the running program cannot write into LocalMachine).

因为这是不可能的。 注册表有多个根节点,但只有两个有趣的根节点:LocalMachine和CurrentUser。 通常,安装程序将值写入LocalMachine,而正在运行的程序仅写入CurrentUser(实际上,除非安装程序与权限混淆,否则运行程序无法写入LocalMachine)。

While keeping leftovers in LocalMachine is laziness (as pointed out by the other answers), it is not possible to clean the CurrentUser part.

虽然将剩余的内容保留在LocalMachine中是懒惰的(如其他答案所指出的),但无法清除CurrentUser部分。

If a program is installed per machine (which most are) and multiple users use it, what should the uninstaller do? It could safely remove the user settings of the current account, but the current account might not be your account. This happens if you started the uninstaller from a non-admin account and then entered the credentials of an admin account, the setup is now running under that account, not the first one.

如果每台计算机都安装了一个程序(最多),并且有多个用户使用该程序,那么卸载程序应该怎么做? 它可以安全地删除当前帐户的用户设置,但是当前帐户可能不是您的帐户。 如果您从非管理员帐户启动了卸载程序,然后输入了管理员帐户的凭据,则会发生这种情况,安装程序现在正在该帐户下运行,而不是第一个。

What about the other users? It could try to enumerate all users, but their registry keys might not be loaded (Windows is lazy and only loads the things it needs).

那其他用户呢? 它可能会尝试枚举所有用户,但可能不会加载其注册表项(Windows是惰性的,仅加载其需要的内容)。

But you should not even try that. If you use roaming profiles (i.e. terminal services) and then delete all settings on uninstall, you could really mess up and delete stuff that is actually still in use. A terminal server is basically one Windows machine where multiple users log-in at the same time and use applications. Say you have two terminal servers running one application. You uninstall the application on TS1, now all the settings for all users are gone on TS2 because you have roaming profiles. Oops.

但您甚至不应该尝试这样做。 如果您使用漫游配置文件(即终端服务),然后在卸载时删除所有设置,则可能会弄乱并删除实际上仍在使用的内容。 终端服务器基本上是一台Windows计算机,其中多个用户同时登录并使用应用程序。 假设您有两个运行一个应用程序的终端服务器。 您在TS1上卸载了该应用程序,现在所有用户的所有设置都在TS2上消失了,因为您具有漫游配置文件。 哎呀。

The same also applies to files in the per-user directories. In the setup of my company’s programs, I delete the per-machine stuff but do not touch the per-user stuff, not even of the user currently running the setup.

每个用户目录中的文件也是如此。 在我公司程序的设置中,我删除了每台计算机的内容,但不触摸每用户的内容,甚至不删除当前正在运行安装程序的用户。

Followed by the answer from Keltari:

随后是Keltari的回答:

There are many reasons why this is the case, however, it is not the fault of Microsoft or the Windows operating system.

出现这种情况有很多原因,但是,这不是Microsoft或Windows操作系统的问题。

The following is a list of some cases and reasons why registry entries are left behind:

下面列出了某些情况以及为什么注册表项被遗忘的原因:

Bad Programming – The developer did not write the application uninstaller properly and the registry entries are left behind. In addition to that, the uninstaller might not have/use the proper permissions to remove the registry entries. It could also be that there is more than one application that uses those keys. For instance, two applications from the same developer that write to the same keys.

错误的编程 -开发人员未正确编写应用程序卸载程序,并且注册表项被留下。 除此之外,卸载程序可能没有/使用适当的权限来删除注册表项。 也可能有多个应用程序使用这些键。 例如,来自同一开发人员的两个应用程序写入相同的**。

Left On Purpose – As one comment mentioned, these entries could have been left on purpose. Some applications have a trial period and, after that period, you might choose to remove the application. If you choose to reinstall the application later, those keys give the application information on when it was installed. In addition to that, some developers might choose to leave those keys in case you choose to reinstall the application. If the developer used registry keys to store your customizations, they might leave them there so that when you reinstall the application, all of your customizations persist. In the grand scheme of things, registry keys only take up a few bytes.

左故意的 -正如一位评论中提及,这些项目可能已经离开故意的。 某些应用程序有试用期,在此期限之后,您可以选择删除该应用程序。 如果您选择稍后重新安装该应用程序,则这些键会提供有关应用程序安装时间的信息。 除此之外,某些开发人员可能选择保留这些**,以防您选择重新安装该应用程序。 如果开发人员使用注册表项来存储您的自定义项,则他们可能会将它们保留在那里,以便在您重新安装应用程序时,所有自定义项都将保留。 在总体方案中,注册表项仅占用几个字节。

Should you remove the keys? That depends. The Windows registry is a dangerous place to mess around in. You can inadvertently break your system. Leaving the extraneous keys will not hurt the system. Some people will say cleaning/defragging the registry will speed up your system, but that has been proven false repeatedly.

您应该卸下钥匙吗? 那要看。 Windows注册表是一个很危险的地方。您可能会无意间破坏系统。 留下多余的**不会损害系统。 有人会说清理/整理注册表碎片将加快您的系统速度,但是反复证明这是错误的

If you really want to get rid of those programs, there are some uninstaller tools that can remove every trace of a program. These programs will watch the installer of another program and record all the actions done to the file system and registry, then completely remove those actions. One issue with these tools is that it is possible they can remove things you might want to keep.

如果您真的想摆脱那些程序,可以使用一些卸载程序工具来删除程序的所有痕迹。 这些程序将监视另一个程序的安装程序,并记录对文件系统和注册表执行的所有操作,然后完全删除这些操作。 这些工具的一个问题是它们可能会删除您可能想要保留的东西。



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/218194/why-do-normal-software-uninstalls-fail-to-remove-all-relevant-values-from-the-registry/

如何从注册表卸载软件