Welcome to MSDN Blogs Sign in | Join | Help

The Patch Cache and Freeing Space

When you install a patch using Windows Installer, the .msp file is cached in the %WINDIR%\Installer directory. This accounts for some of the space required by Visual Studio 2005 Service Pack 1. A single patch is cached only once regardless to how many products the patch applies.

Starting with Windows Installer 3.0, any patches that contain the MsiPatchSequence table cause the Windows Installer service to cache any of the original files being replaced into the baseline cache. Any files being replaced in the latest minor upgrade by small update patches with this table are also cached. It is this baseline cache that consumes a lot of drive space on the system drive after installing VS 2005 SP1. The baseline cache facilitates patch uninstall by storing the original files so that they can be copied back to the target locations. Files in existing patches do not need to be cached because they are contained within the cached .msp files. For this reason and because Windows Installer will require these patches during repair and future patch scenarios, the .msp files should not be deleted except by uninstalling the patch from each product to which it's applied. The baseline cache also improves performance when using binary deltas.

Baseline caches are created separately for per-user unmanaged installations, and for both per-user managed and per-machine installations. If you enable Windows Explorer to display system files or type dir /a:s under %WINDIR%\Installer you'll find a directory structure like the following:

  • %WINDIR%\Installer
    • $PatchCache$
      • UnManaged
        • {UserSID}
          • {Squished ProductCode}
            • {ProductVersion}
      • Managed
        • {Squished ProductCode}
          • {ProductVersion}

Be careful doing any modifications under %WINDIR%\Installer. Like registry changes, making mistakes here could cause problems that may require the difficult task of rebuilding the Windows Installer cache or even reinstalling Windows.

To free up space, you can remove the baseline cache for Visual Studio 2005 under %WINDIR%\Installer\$PatchCache$\Managed by deleting the directory with the squished GUID representing the ProductCode for whichever Visual Studio 2005 products you have installed. The squished GUID is a transformed ProductCode. Attached you'll find a list of product names, product codes, product languages, product editions, and squished GUIDs for Visual Studio 2005 and the .NET Framework 2.0.

Again, be aware that by removing the baseline cache for a product, future repair, patch install, and patch uninstall scenarios may require your original installation media. If you have the drive space it is recommended that you keep the baseline caches available.

Published Wednesday, January 17, 2007 10:14 AM by Heath Stewart
Attachment(s): Squished Product Codes.csv

Comments

Tuesday, January 30, 2007 4:04 PM by AJ

# re: The Patch Cache and Freeing Space

I thought I'd toss out a well-known but often overlooked house cleaning tip.  MsiZap G! is helpful for clearing out Windows Installer resources that are no longer being referenced.  For whatever reason, Windows Installer doesn't have the best garbage collection after an uninstall or rollback.

Tuesday, January 30, 2007 10:46 PM by Heath Stewart

# re: The Patch Cache and Freeing Space

Take care when using msizap, though. "G!" is safe, but exploring other switches without understanding their ramifications could mean you cannot patch products anymore because product registration is missing (essentially making it appear to Windows Installer that your product is not there). Treat this like editing the registry.

Thursday, February 01, 2007 12:16 AM by Heath Stewart's Blog

# How to Safely Delete Orphaned Patches

If Visual Studio 2005 Service Pack 1 fails to install, you might find additional .msp files under %WINDIR%\Installer

Monday, March 19, 2007 1:30 AM by Roger

# re: The Patch Cache and Freeing Space

Thanks for the information -  I just ran MsiZap G! and cleaned up 14 gigs of space from my C drive!

There were a lot of files in my C:\windows\installer folder - the end result of installing 100's of programs over the last two and a half years.  Nice to know I can safely clean the installer folder since it was so large in size and because it's only going to keep growing in size as I'm continually installing and unistalling software and I am never ever going to do a clean reinstall of windows.

Tuesday, November 20, 2007 12:07 PM by Heath Stewart's Blog

# How to Install TFC without PPE

Microsoft Visual Studio 2008 , now available for MSDN subscribers and Express editions freely available

Friday, July 25, 2008 2:20 AM by Heath Stewart's Blog

# Why Windows Installer May Require so much Disk Space

Windows Installer is an engine for performing transactional installations. When installing a product

New Comments to this post are disabled
 
Page view tracker