Windows Installer indeed has a reputation for being slow. There are a few things that contribute to this and I'm going to address them below. But ultimately, one should ask themselves if one, two, or three minutes is really a matter of contention when installing and uninstalling software. I take more time than that flipping through TV channels :)
The Registry
This is the culprit number one. Windows Installer makes heavy use of the registry for its operations. As your system matures, as you install and uninstall applications and as the registry grows in size or becomes fragmented, MSI will become slower. The same application will install and uninstall much faster on a pristine Windows installation, than it will on a matured system. The solution here is to try and keep the registry clean and defragmented.
For registry cleaning, use one of the many tools available out there. But for registry defrag I cannot recommend enough NTREGOPT for internal hive optimization and PageDefrag for physical file defragmentation.
The reason MSI operations may become slow on the registry has to do with how MSI uses it. Windows Installer uses the registry to keep track of which Products have installed which Components and to which Location it was installed. The original installation GUIDs are used in compressed format. Per-machine information about installs can be found at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18
, whereas per-user data is found next to it on a under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
and on a key with the user SID.
Both these keys can be quite large and contains numerous subkeys and values. They control Products, Components and KeyPaths of each installed application. All this information must be read and processed for a correct uninstallation procedure. However the registry format lists keys in alphabetic order which allows for binary searches. But the values are not. They are stored as they are created, so a linear search procedure must be performed. Which slows down the algorithm performance.
All in all, MSI is a rather complete and accurate method for installation and uninstallation of software. But it suffers from its registry dependency. The system is excellent. It is the Windows registry that should have had its overhaul a long time ago :)
For more advanced information:
For a deep analysis of what MSI is doing during each install or uninstall procedure, refer to this article that explains how to setup MSI Debug. Or, for less but still valuable information, this one one how to activate logging.
I just want to note, this is only true if you (1) disable the system restore checkpoint feature, and (2) it's a gigantic installer (which is not unique to Windows Installer -- I've seen lots of slow Inno installers, simply because they're huge). I've had Windows installers install and remove themselves in (literally) a handful of seconds. (For example, Bootvis installs in 3 seconds on my system. It uninstalls in the same amount of time. And no, my system isn't blazing fast either.) The difference is that Windows Installer has a lot more features, so larger programs use it more often. – user541686 – 2011-11-01T03:25:37.840
@Mehrdad did you mean (1) enable system restore? – Chris S – 2011-11-01T11:48:44.667
Indeed yes, typo. – user541686 – 2011-11-01T15:59:18.063
2I came here because MSI uninstall was taking forever... and actually the reason was that the pop-up
Do you want to allow the following program from an unknown publisher to make changes to this computer?
was hiding in the background. – Nicolas Raoul – 2013-09-30T08:12:11.237See this answer for technical details for speeding up MSI installations: http://superuser.com/a/296534/11906
– Stein Åsmul – 2014-05-13T00:21:31.667