Share via

Windows Confidential: The Legend of Uninstall

Even doing something as simple as installing or uninstalling a program requires Windows to dig up information such as application size and date.

Raymond Chen

When you install and uninstall programs, there’s a lot that happens behind the scenes. Where does the Programs and Features function go to get the application size and install date? That’s been a moving target.

Windows 95 introduced a control panel known as Add/Remove Programs. In its original incarnation it merely provided a list of applications that had registered an uninstaller. When you asked to uninstall a program, Windows ran the registered uninstaller—not too complicated at all.

After Windows 95, user research identified a problem some people were having. Their hard drive would fill up, and they’d want to uninstall an application to free up disk space. However, the existing Add/Remove Programs list wasn’t much help figuring out which programs were worth uninstalling. The name of the application in the list was not always sufficient to determine whether the application was worth keeping.

Name, Rank and Serial Number

With Windows 2000, Microsoft added a number of heuristics to the Add/Remove Programs list to help users make more informed decisions. User research determined that the date of application installation, the amount of disk space it consumed and how often you use that application would most help users decide which programs to uninstall. That’s great information to have, but how do you get it?

The only thing applications were required to provide when they registered for uninstall was application name and a path to the uninstaller. So where would all this other information come from?

When they registered for uninstall, applications had the option of writing the install date and application size. But what if an application didn’t provide that information? What about the application usage information?

Add/Remove Programs had to start guessing. For each application registered to uninstall, Add/Remove Programs goes through all the shortcuts on your Start menu and looks for words in the shortcut name that match those in the name of the uninstall entry.

For example, if Add/Remove Programs is looking for “Awesome Program for Windows” and it found a Start menu shortcut called “Pretty Good Program for Windows,” that would count as a two-word match. The words “Program” and “Windows” appear in both. Add/Remove programs would then choose the name with the highest number of matches. If the number of matches is at least two, it uses that shortcut target usage frequency as the application usage frequency.

Guessing Game

If the application uninstall information doesn’t include an install date or application size information, the guessing game continues. Add/Remove Programs searches the Program Files directory on all drives in a manner similar to the Start menu. It looks for a directory name with at least two words in common with the application name. If it still can’t find anything, it looks in the root directory of all drives.

The winning directory establishes the application size. The creation date is taken as the application install date. Remember, you can have Windows avoid this disk search by simply registering the application install date and size as part of the uninstall entry.

If more people knew how unreliable the Add/Remove Programs control panel can be, they’d be less interested in using it as a source for that information. Recently, a customer wanted to know how to get access to the “Last used on” information for each application so they could automatically uninstall programs that weren’t recently used. That’s only slightly more reliable than asking a teenager at the skateboard park next door how much homework he has tonight.

The Add/Remove Programs control panel received a visual restyling in Windows XP, but the underlying functionality remains the same. One change most people failed to notice is that the slash disappeared. The control panel name became Add or Remove Programs.

With Windows Vista, the Add or Remove Programs control panel received a more substantial makeover. Instead of being a custom control panel, it’s more like a traditional Explorer window. As part of the makeover, its name changed once again—this time to Programs and Features.

There was another subtle change as well: It no longer displays “Frequency of use.” Because it no longer displays “Frequency of use,” Windows no longer needs to go through those calculations. That got rid of the Start menu search.

Search No More

In Windows 7, the last of the disk searching disappeared. If an application doesn’t register an install date, Windows infers it from the date the registration information was created. If an application doesn’t register an estimated size, Windows simply leaves the column blank.

Why did this information slowly disappear from the Programs and Features control panel? When this feature was first introduced back in 2000, hard drives were tiny by today’s standards. Filling a hard drive was a frequent source of frustration. Over time, hard drive capacities have grown dramatically. Running out of disk space is no longer high on the list of problems faced by typical users.

Remember when Microsoft launched TerraServer in 1998 and everybody’s mind boggled at the concept of 1TB of disk space? Storage for all that data (around 3TB) occupied 324 hard drives in seven storage cabinets. Today, you can get 1TB of disk space for around $100—and it fits in your hand.

Raymond Chen

Raymond Chen's* Web site, The Old New Thing, and identically titled book (Addison-Wesley, 2007) deals with Windows history, Win32 programming and the underground moon cake economy.*