Windows在卸载软件时如何找到安装位置 [英] How does Windows find the installed location when uninstalling software

查看:763
本文介绍了Windows在卸载软件时如何找到安装位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行允许自定义安装位置/路径的安装程序时,文件将正确放置在我选择的位置.

When I run an installer that allows a custom install location/path, the files will be correctly placed at the location that I select.

当我运行相同的MSI并选择删除"(或从添加/删除程序"中卸载)时,它如何知道安装位置,以便删除正确的文件?

When I run the same MSI and select remove (or uninstall from add/remove programs), how does it know the install location so the correct files are removed?

我认为它将存储在计算机\ HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall {GUID}"中,但是当我查看安装软件的位置时,"InstallLocation"

I thought it would be stored at 'Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{GUID}', but when I look at that location for my installed software, the 'InstallLocation' key is empty.

但是,无论我如何卸载,无论我将其放在何处,它都知道要删除哪个文件夹.该信息存储在注册表中的其他位置还是MSI文件本身中?

However, no matter how I uninstall it, it knows which folder to go remove, no matter where I put it. Is that information stored elsewhere in the registry, or in the MSI file itself?

推荐答案

这是一个非常复杂的问题,因为可以对MSI进行配置,以将其卸载文件放置在您告诉它的任何位置.通常默认情况下,尽管它将在C:\ Windows \ Installer中创建一个具有特定名称的卸载.msi文件.

This is a very complicated question as MSI can be configured to drop its uninstall files anywhere you tell it. Usually by default though it will create an uninstall .msi file with a specific name in C:\Windows\Installer.

但是不要依赖放置在此目录中的卸载.msi,也不要依赖于卸载"注册表项中的卸载路径.关键在于最终用户的便利性.

But don't depend on the uninstall .msi being placed in this directory and don't rely on there being an uninstall path in the Uninstall registry key. This key is as much about convenience for the end-user as anything else.

卸载信息通常包含在MSI文件中,但不必包含在安装过程中,它可以创建密钥来帮助升级和卸载.安装将保留在注册表中的信息完全取决于您如何配置.msi数据库.

The uninstall information is usually contained within the MSI file, but it need not be and during installation it can create keys to aid upgrading and uninstallation. The information that an installation will leave in the registry is entirely down to how you configure the .msi database.

添加更多内容...许多安装程序,例如Nullsoft,InstallAware和InstallShield,喜欢做自己的事情,并将其卸载信息放在其他位置.因此,InstallShield喜欢创建一个InstallShield安装信息文件夹,而Nullsoft喜欢创建.dat文件和一个uninstall.exe.但除此之外,这些安装程序仍在调用MSI并创建安装表和数据库.因此,实际上在哪里可以找到卸载信息,这并不是一门精确的科学方法!

Adding a few more things... many installers like Nullsoft, InstallAware and InstallShield like to do their own stuff and put their uninstall information in other places. So InstallShield likes to create an InstallShield Installation Information folder and Nullsoft likes to create .dat files and an uninstall.exe. But beyond all this, these installers are still invoking MSI and creating installation tables and database. So where the uninstall information is actually located it not an exact science!

这篇关于Windows在卸载软件时如何找到安装位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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