The Windows Add/Remove Programs Applet

Mar 3

The Windows Add/Remove Programs Applet

I got to wondering the other day how the Windows Add/Remove Programs control panel applet works. It turns out that it’s not that complicated.

The list of programs you can uninstall is stored in the registry under:

HKEY_LOCAL_MACHINE /
Software /
Microsoft /
Windows /
CurrentVersion /
Uninstall

If there’s one there you want to get rid of, just boink the registry key. (If that’s too primal for you, TweakUI supposedly has support for it, though I couldn’t find it. Besides, deleting the keys is what Microsoft recommends anyway — don’t be a wuss.)

Each entry has two subkeys: “DisplayName” and “UninstallPath.” DisplayName is what’s…well, displayed, and UninstallPath is the shell command that’s run when you try to uninstall it. Those are the only two required entires, though there are several more. For instance, here’s the entry for my beloved PowerGrep:

(Where does all this come from? If you use an installer creation program to deploy your app, you can usually specify it in the wizard. Here’s an example from the Installshield documentation. Here’s a list of all the properties in the Windows Platform SDK.)

In the case of PowerGrep, you can see that when you uninstall it, it just runs a program called “Undeploy.exe” and passes it the log of how it installed itself. I took a look in that file, and it’s just what you expect: a list of all the files and registry keys that were installed. This is just one app, of course, but the theory is fundamentally the same for every app.

But how about this piece of magic:

How does this applet calculate the size of the program and how often it’s used? Well, the program can provide this information itself (see the EstimatedSize key in the screen capture above), or Windows can estimate it…poorly. Windows Ninja Raymond Chen provides some insight:

So Add/Remove Programs starts guessing. It goes through all the programs on your Start menu and compares their names with the display name of the uninstallable item. It looks for Start menu items which share at least two words with the words in the DisplayName.

[…] Add/Remove Programs looks in your “Program Files” directory for directories whose names share at least two words in common with the DisplayName. The best match is assumed to be the directory that the program files are installed into. The sizes are added together and reported […]

Eeesh. Ugly. But that’s how it’s done.



Add Comment


Want to advertise on this site? Contact FM.
Laser Toner Cartridges UK laser toner, toner cartridges, hp toner, lexmark toner, samsung toner, canon, toner, epson toner, oki toner, kyocera toner, xerox toner, remanufactured toner, compatible toner
Direct TV Deals Free 4 room direct tv deals. no equipment to buy. free fast professional direct tv installation. this is the best direct tv deal available anywhere.
SEO Article Learn from the experts with our SEO article.
rope light Shopping with birddog distributing, inc., gives you access to the lowest prices, the best customer service and the quickest delivery times possible.
Laptop AC Adapter We offer genuine factory direct replacement AC adapters.
Direct TV Best satellite TV deals.
Direct TV Deals Direct TV programming deals are varied and include packages containing from 50 channels up to over 250 channels.
8mm film to DVD Retain family memories with the only frame by frame digital restoration service in the United States for your 8mm film to DVD today
Rubber Stamp Shop for custom self-inking stamps, hand stamps, address stamps, label stamps, check endorsement stamps, check deposit stamps, date stamps, pre inks, pocket stamps, ink and much more!