# Can You Clean Up the C:\Windows\Installer Folder?

`C:\Windows\Installer` is the Windows Installer cache. It holds a copy of every MSI package and MSP patch that installed software through Windows Installer, and Windows uses those copies when you later update, repair or uninstall that software. Microsoft's guidance is short: it should not be deleted. Damage does not show up right away, only the next time an app tries to update or uninstall, and Microsoft offers no supported tool that clears it. Space comes back safely from uninstalling software you do not use and from other cleanup, not from this folder.

## What the folder holds

[Microsoft's support article on the installer cache](https://learn.microsoft.com/en-us/troubleshoot/windows-client/application-management/missing-windows-installer-cache) explains why they are there: when a product is installed with Windows Installer, the cache stores files that are required for uninstalling and updating it. A 2008 post by Heath Stewart on [Microsoft's setup team blog](https://devblogs.microsoft.com/setup/why-windows-installer-may-require-so-much-disk-space/) adds the detail: the cached copy is either an `.msi` with its embedded cabinets removed, or a whole `.msp` patch, and it stays there for all later maintenance, including uninstalling the product. Patches are kept whole because they carry the updated files.

That is why the folder grows with patched MSI products: each patch adds a cached `.msp`, and the folder becomes a record of everything those products may need again. Microsoft's article itself singles out SQL Server and Office, which are common sources on work PCs.

<figure class="blog-diagram">
  <picture>
    <source media="(max-width: 900px)" srcset="/img/blog/windows-windows-installer-folder-cleanup-en-mobile.webp" type="image/webp" width="768" height="1180">
    <img src="/img/blog/windows-windows-installer-folder-cleanup-en.webp" width="1360" height="454" loading="lazy" alt="When Windows uses its cached installer packages">
  </picture>
  <figcaption>The package is copied into the cache at install time, then read again for updates, repairs and the eventual uninstall.</figcaption>
</figure>

## Why deleting files breaks things later

Microsoft's article is explicit that problems may not appear until you uninstall, repair or update a product. Removing a cached file looks harmless on the day you do it; months later an Office update or an uninstall fails. The same article lists errors that missing cache files can produce in setup logs:

| Code | Message in short |
| --- | --- |
| 1612 | The installation source for this product is not available |
| 1620 | This installation package could not be opened |
| 1635, 1636 | This update package could not be opened |
| 1642 | The upgrade cannot be installed, the program to be upgraded may be missing |

These codes have other causes too, so seeing one does not prove the cache was damaged. What makes deletion costly is recovery: Microsoft says missing files cannot be copied from another computer because they are unique, Windows support cannot recover them, and restoring only the missing files from a backup is not possible. The options it lists are the application vendor's own repair steps, a System Restore point, a full system state restore, or reinstalling Windows and the applications.

## The hidden `$PatchCache$` folder

Inside the folder sits `$PatchCache$`, the baseline cache. When a patch updates a product, Windows Installer can save the older versions of the files it replaces, so a later patch or patch removal does not have to ask for the original installation media. [Microsoft's MaxPatchCacheSize reference](https://learn.microsoft.com/en-us/windows/win32/msi/maxpatchcachesize) describes the limit: by default the cache may use up to 10% of the disk, a policy value of 0 stops new files from being saved, and changing the policy does not affect files already saved.

The 2008 setup blog post says these baseline files can be deleted, with a cost: removing a patch or restoring missing files may then ask for the original source media, which many people no longer have for software they downloaded years ago. It also does not recommend turning the cache off. Measure it first with the commands below; if it is small, the trade is not worth making.

## Measure before deciding anything

These read-only commands show how large the folder and its baseline cache are. Run PowerShell as administrator; they only read sizes.

```powershell
(Get-ChildItem C:\Windows\Installer -Force -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum / 1GB
(Get-ChildItem 'C:\Windows\Installer\$PatchCache$' -Force -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum / 1GB
```

Compare the result with the whole drive. A few gigabytes on a 500 GB drive is part of having patched software installed. If the number is very large and the PC has Office or SQL Server, those products are the usual source, and the right tools are theirs.

## Orphaned packages: official routes only

Patches left behind after a product's removal, often called orphaned packages, are the reason people look for cleanup tools. Microsoft's article addresses this directly: some third parties claim to rebuild or repair the installer cache, Microsoft cannot recommend or endorse any of them, and you use them at your own risk. There is no general Microsoft tool that decides which cached files are unused and deletes them.

What exists is product-specific. For SQL Server, the same article links Microsoft's procedure for restoring missing cache files during a SQL Server update. For Office, it points to the Robust Office Inventory Scan and a patch maintenance utility. If a specific product's update fails with one of the errors above, start with that vendor's repair or uninstall instructions rather than with the folder.

## Safer ways to recover the space

- **Uninstall software you do not use** through Settings › Apps › Installed apps, following [Microsoft's uninstall steps](https://support.microsoft.com/en-us/windows/uninstall-or-remove-apps-and-programs-in-windows-4b55f974-2cc6-2d2b-d092-5905080eaf98). Removing software through its uninstaller is the route Windows Installer is built around, rather than removing its files behind its back.
- **Run Disk Cleanup's system file categories.** Windows Update Cleanup and Delivery Optimization Files are covered in [Disk Cleanup vs Storage Sense](/windows/blog/disk-cleanup-vs-storage-sense-windows), and the component store in [WinSxS cleanup](/windows/blog/winsxs-folder-cleanup-windows).
- **Check the large root files.** `hiberfil.sys` and `pagefile.sys` often hold several gigabytes; [Hiberfil and pagefile on C:](/windows/blog/hiberfil-pagefile-c-drive-windows) explains the trade-offs.
- **Find what actually fills the drive.** Games, videos, virtual disks and Docker data are more common culprits; start with [finding large files](/windows/blog/find-large-files-on-windows).

`C:\ProgramData\Package Cache` deserves the same care. Microsoft's [Dev Drive documentation](https://learn.microsoft.com/en-us/windows/dev-drive/) describes a package cache as the place applications keep source files needed to update, uninstall or repair installed software, and names Visual Studio as an app that stores much of its data there.

## What not to do

Do not take ownership of `C:\Windows\Installer` to delete it, do not empty it to make a cleanup total look better, and do not copy cache files from another PC to replace missing ones. Do not run a script that removes "orphaned" `.msp` files unless the vendor of the affected product supplies it.

Mole for Windows leaves both folders alone. Clean has no rule for `C:\Windows\Installer` or `Package Cache`, and when Apps looks for leftovers after an uninstall, it treats folders named Installer or Package Cache as shared by Windows and every app, never as belonging to the one being removed.

## FAQ

### Can I delete the Windows Installer folder?

No. Microsoft says the Windows Installer cache should not be deleted. Apps that installed with MSI need it to update, repair and uninstall, and the failures appear later.

### Why is C:\Windows\Installer so big?

It keeps a copy of every MSI package and every MSP patch applied to installed software, so products that receive many patches, such as Office or SQL Server, make it grow.

### Is it safe to delete $PatchCache$?

Microsoft's setup team has said the baseline cache files can be deleted, but removing a patch or repairing files may then ask for the original installation media. Measure its size before deciding.

### Is there a Microsoft tool to clean up the Windows Installer folder?

No general one. Microsoft does not endorse third-party cache cleaners and offers product-specific steps for SQL Server and Office. Uninstall unused software through Settings instead of editing the folder.


Canonical: https://mole.fit/windows/blog/windows-installer-folder-cleanup
