blog

Is It Safe To Remove Files In C:\Windows\Installer? [Cleanup]

Drive Space. On a computer’s boot drive this is often in short supply. Even moire so these days with small Solid State (SSD) options and RAID partitioning of a large data set. Leaving too little room for the boot drive is a common mistake. So, while you’re looking at that boot drive, you notice that the folder C:\Windows\Installer is using a heck of allot of space and wonder, can I get rid of that stuff? Well, I’m here to explain what you can and can’t clean.

To start with – a disclaimer. I’m going to talk about removing stuff from your computer. Deleting files can cause some serious issues,  so tread lightly with this information. Don’t ever attempt this without a backup or a way to return your system to full operation.

Windows keeps a number of MSI and MSP files in C:\Windows\Installer and collectively, these files make up what’s called the Windows Installer Cache. This function is generally present on Windows XP and above.

But, you may be reading this wondering if you really need to worry about the C:\Windows\Installer folder? A good way to find out is use the free TreeSize application provided by Jam Software (get it here). Run that and let it scan your boot drive. On one such occasion (on a server) I found this much space taken up by the Installer folder (Yes, that’s 3.5 GB!):

The easiest way – MSIZAP.EXE
While easy, this tool has been discontinued from Microsoft. So, at worst it’s referred to on microsoft.com (see here) and you can’t get it – or you’ll keep getting linked to a page that has removed the download option (see here). This all really sucks, because you’ll have to go to a less-trusted third-party source to find the file and risk a virus.

MSIZAP is a small utility that came with a larger package called “Windows Installer Cleanup Utility”. It may also be possible to get this in a Windows SDK. The utility was intended mainly to removed installer references to programs that weren’t removed properly. In addition though, there’s a command (run this in Command Prompt) that you can use to deleted orphaned installer files:

C:\Program Files Windows Installer Clean Upmsizap G!

If you can get that utility, and are willing to take the risk of using something Microsoft no longer supports.  This may work for you. If you want a more reliable option, read on.

The safer, more painful way – a script
Another option (one that I used in my example) was to use a script written by Heath Stewart on MSDN (see his blog here). Heath explains how these files might be removed and provides a simple script to show you what installers ARE needed.

Essentially what you get when the script runs is a series of basic pop-up message windows that list an installer that is required by the current system. They look like this:

You’ll need to go and select that file (and every one else that comes up) in the file manager of your choice and then when the script is finished INVERT the selection. The files now selected can be removed and/or stored somewhere else.

Yes, that’s allot of pop-ups and yes that’s painful. It would be a great little side project to take that script and updated it to gather a list of unused files and place them in a batch file or text file that can be used to deleted or compress later.

Final Thoughts
After removing (in this case I compressed all the files and placed them in an alternate location), I was able to get the C:\Windows\Installer folder down to a mere 795 megabytes.

Certainly, it’s a shame Microsoft doesn’t provide really useful tools for cleaning up this kind of data. I would even think that Sysinternals would have made a tool for something like this (correct me if they have). Now, go clean up that drive!