1

When you uninstall a program, Windows finds all the programs files, and deletes them, where does it store the file containing, all the paths of these files? (Specifically Windows 7). Sorry, if this is a duplicate, it is hard to word this question :)

EDIT #1: I saw this, but I want to know for all programs, not just .msi's.

Noah Cristino
  • 168
  • 10
  • I believe most of them are in HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall. – BillDOe Jun 10 '17 at 23:42
  • It is up to the individual uninstallers to decide how and where to store the the file and registry information. – AFH Jun 10 '17 at 23:45
  • Just curious, are you looking to completely remove an uninstalled program? Most uninstallers still leave pieces of the software in your system, sometimes in case you want to reinstall it later, other times because they're sloppy. – BillDOe Jun 11 '17 at 01:51
  • @BillOertell I want to get all the files from the program, so I can move it to anther computer. – Noah Cristino Jun 11 '17 at 12:17
  • @NoahCristino, I know it's not the question you asked, but moving a program from one computer to another, without simply installing it on the other, is probably more complicated than moving the program's files and registry uninstall entries, depending on the program in question. A program's registry entries are usually spread all over the registry. Maybe you should ask that separate question. – BillDOe Jun 11 '17 at 23:26
  • @BillOertell Yeah, that's why I'm also looking at getting the locally stored installer from `LocalPackage`, but not all program have it... – Noah Cristino Jun 12 '17 at 00:36

2 Answers2

1

The location of uninstall information can vary depending on the program. For some programs, e.g., the ones you see under "Uninstall or change a program", if you attempt to uninstall a program through the Control Panel, you can find the program that will uninstall software under the Windows registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall or HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall. Some may be under one of those locations in the registry while others may be under the other registry location.

You can run the registry editor program regedit and browse to those locations in the registry. If you look at the keys for a particular program, you may see one named UninstallString that will point to the location of the program that will be run when you choose to uninstall the program through the Control Panel. That uninstall program is normally in the directory where the program's files have been placed. For some programs, you may see an InstallLocation key under an entry with a name matching the name of the relevant program that points to the directory where the program's files are located.

moonpoint
  • 5,080
  • 2
  • 19
  • 22
  • Great answer, but my question is how does the uninstaller know what files to delete? and does it store the installer anywhere? – Noah Cristino Jun 11 '17 at 12:19
1

It is entirely up to the vendor of each application to provide an uninstaller. There is no universal standard place where the list of files/reg settings that need to be removed are stored. This is why so many programs leave a ton of their garbage all over the hard drive. Most programs simply do not clean up after themselves very well.

Most software vendors package their software in a 3rd party installer, the most common of which are InstallShield (Flexera Software) or Microsoft Windows Installer (.msi). These installer products allow software vendors to define tables that contain all the files and reg settings in the payload and where they go. They also provide a scripting language that vendors can use to make decisions during the install process.

These products make deploying applications easy for vendors without having to write their own installation routines, but the point is that it's still up to each vendor to actually use those features. Both Microsoft and InstallShield automatically generate a basic uninstall routine for you when you build a project, but it just removes the files and reg settings listed in the tables -- provided they haven't changed. They won't remove anything added after or any settings in the user directory, and they won't apply any intelligence to the uninstall by default. If anything is ambiguous, it gets left alone.

It is for this reason that uninstallers are so sloppy and why it's practically impossible to cleanly remove an application when that vendor was just too lazy to think about such things (or worse in the case of crapware, doesn't want you uninstalling their app).

Wes Sayeed
  • 13,662
  • 6
  • 41
  • 76
  • Good answer, but how does the uninstaller know what files to delete? and does it store the installer anywhere? – Noah Cristino Jun 11 '17 at 12:20
  • The uninstaller stores the location of files and registry entries wherever the developer chooses. There may be a list in the registry, wherever the developer chooses. Or it may be hard coded in the uninstaller itself, wherever and however the developer chooses. Or it may be elsewhere. There are no real standards for this, only conventions and they are frequently ignored. Details regarding this kind of thing are rarely published. Developers have the very reasonable attitude (from their perspective) that why would anyone want to uninstall their wonderful program? – LMiller7 Jun 11 '17 at 13:08
  • @NoahCristino; The tables that store this information are inside the installer package itself. Most programs store a local copy of the installer somewhere on the hard drive so that you can use them to uninstall the program later. But in most cases these files are not human-readable, and again, their location and capabilities are entirely up to the developer. – Wes Sayeed Jun 11 '17 at 23:08
  • @LMiller7 I'm trying to get the files to transfer the program to another computer. I need to get a list of files to move, or a copy of the installer, which isn't always available... – Noah Cristino Jun 12 '17 at 00:33
  • @NoahCristino; It's likely you won't be able to do this for anything but the simplest of applications. Copying an entire application from one computer to another just isn't a thing most Windows apps are designed to do. – Wes Sayeed Jun 12 '17 at 00:48
  • @WesSayeed Then how do programs like https://www.easeus.com/tutorial/pctrans-free-user-guide.html work? – Noah Cristino Jun 12 '17 at 23:55