Microsoft Windows Registry Guide, Second Edition
Removing Windows Installer Data
If you thought manually removing legacy applications was difficult, try removing a Windows Installer–based application manually. More than once I've broken Windows Installer–based applications so badly that I couldn't remove them, repair them, or reinstall them. In these cases, I either had to manually remove the application's Windows Installer data from the registry or reinstall Windows. Tools are available to automate this process, and you learn about them in this chapter. Removing Windows Installer data without these tools is akin to replacing transistors on your computer's mainboard–it's not really possible.
Before I introduce the tools, I'm going to point you to the location in the registry where Windows Installer stores data about the applications that it installs. Don't modify these settings using Registry Editor (Regedit) because doing so will likely cause problems. Understanding the relationships among all the different bits of data that Windows Installer stores in the registry is difficult. This is just good information to have available:
- HKCU\Software\Microsoft\Installer.
This branch contains per-user Windows Installer data for applications that you install per user.
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer.
This branch contains Windows Installer data for per-computer applications and for managed applications.
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
This branch contains removal information for Windows Installer–based programs.
- HKCR\Installer.
This branch contains information similar to the Installer key under HKLM.
The tools that you learn about in the next two sections come with Windows Support Tools. You install the tools from \Support\Tools on your Windows CD.
Msizap.exe
Msizap is a tool that removes most of the data that Windows Installer maintains for an application. It doesn't remove the application's files or settings from the hard disk, however; you have to remove those yourself. You can focus this utility on a single application, or you can make sweeping changes to the Windows Installer data. I've had good luck using Msizap to remove a single application's Windows Installer data from the registry, but I don't trust it to make huge changes, such as removing all the Windows Installer folders and registry keys.
The following examples show the different forms of the Msizap program's command line. The first two forms in the example are the most useful. In the first form, you specify the product code, which is the product's unique GUID. You're not likely to know the product code, so you'll want to use the second form. In the second form, you specify the path and the name of the package file. Then Msizap will look up the product code for you. For example, if you installed Office 2003 Editions and couldn't remove it using Add Or Remove Programs, you'd type msizap T! pathpath\proplus.msi in the Run dialog box. Path is the path containing the package file Proplus.msi. After Msizap finishes removing the application's Windows Installer data from the registry, you'll still have to remove plenty of files. You'll want to get rid of the application's files and other settings that it might have stored in the registry. For example, you'll still see the application's shortcut on the Start menu, but when you click it, you'll see an error message telling you that the application isn't installed. Chapter 3, “Backing Up the Registry,” describes how to manually remove a program after you've got it to this step.
msizap T[A!] productcode msizap T[A!] packagefile msizap *[A!] ALLPRODUCTS msizap PSA?!
* | Remove all Windows Installer folders and registry keys, adjusting shared DLL counts and stopping the service. |
T | Remove all Windows Installer information for a product. |
P | Remove the in-progress key. |
S | Remove rollback information. |
A | Give administrators full control of targeted folders and keys instead of removing them. |
W | Apply changes for all users instead of just the current user. |
G | Remove cached Windows Installer files that are orphaned. |
! | Automatically respond Yes to all prompts. |
? | Display help. |
TIP
I'm not comfortable with manually removing a program's files and registry settings after using Msizap. Most large applications store settings in the registry beyond the typical HKU\Software\VendorVendor\Product\Product\Version keysVersion keys. For example, they register components in HKCR, and you might not get rid of them all. My solution seems odd, but it works well. Zapping a program's Windows Installer data from the registry should enable me to reinstall it. So I reinstall the application and then use Add Or Remove Programs to remove it. Windows Installer is likely to do a much cleaner job of removing the application than I am.
Msicuu.exe
Windows Installer Clean Up (Msicuu.exe in the Windows Support Tools) puts a graphical user interface on Msizap.exe. If you're sitting at the computer, use this tool instead of using Msizap at the command prompt. It's less error-prone.
In the Run dialog box, type Msicuu, and click OK.
In the Windows Installer Clean Up dialog box, shown in Figure 13-1, click the application for which you want to remove Windows Installer data from the registry, and then click Remove.
Confirm that you want to remove the application's Windows Installer data from the registry by clicking OK.
Figure 13-1 Windows Installer Clean Up is the graphical version of Msizap.