C:\Windows\Installerディレクトリについて

 長期間Windowsを使っていると、C:\Windows\Instellerディレクトリのディスク使用量が非常に大きくなってしまうことがあります。
 ここはソフトをインストールしたり、patchを当てた際の情報が残っているようです。
 インストール後に再インストールなどしないのであれば無くてもかまわないような気がしますが、上記ディレクトリにあるファイルを単純に消してしまうと、ソフトが起動しなくなったりして支障があります。


 上記ディレクトリを整理する場合、Windows Installer CleanUp ユーティリティという不要なファイルを消すためのツールを使って処理することが出来ます。
 ユーティリティの詳細についてはにあります。


 ユーティリティーインストール後、コマンドプロンプト

C:\>cd "C:\Program Files\Windows Installer Clean Up"
C:\Program Files\Windows Installer Clean Up>MsiZap G!

 上記コマンドで壊れたキャッシュファイルなどを削除してくれます。
 自分の環境の場合、40GB使われていたのですが1GB程度になりました。動作にも問題は起きていません。


 MsiZap.exeのコマンドラインオプションは

$ ./MsiZap --help
Copyright (C) Microsoft Corporation.  All rights reserved.
MSIZAP - Zaps (almost) all traces of Windows Installer data from your machine.

Usage: msizap T[WA!] {product code}
       msizap T[WA!] {msi package}
       msizap *[WA!] ALLPRODUCTS
       msizap PWSA?!

       * = remove all Windows Installer folders and regkeys;
           adjust shared DLL counts; stop Windows Installer service
       T = remove all info for given product code
       P = remove In-Progress key
       S = remove Rollback Information
       A = for any specified removal, just change ACLs to Admin Full Control
       W = for all users (by default, only for the current user)
       M = remove a managed patch registration info
       G = remove orphaned cached Windows Installer data files (for all users)
       ? = verbose help
       ! = force 'yes' response to any prompt

CAUTION: Products installed by the Windows Installer may fail to
         function after using msizap

NOTE: MsiZap requires admin privileges to run correctly. The W option requires that the profiles for all of the users be loaded.

 となっています。コマンドの詳細なヘルプはG?などとすると読むことが出来ます。詳細な説明についてはMsizap Overview: File and Storage Services | Microsoft Docsに英語ですがあります。


 ちなみにGUIのmsicui.exeでSelect AllしてRemoveしては駄目です。MS Officeなどが起動しなくなります。再インストールでなんとかなりますが、なかなか大変です。よく読まないで実行して大変な目にあいました…。注意しましょう…。