Delete orphaned msi files

2

I have a computer with 50GB of hard drive and it is almost full (I won't get an upgrade for C because is the company computer) I just check and the C:\Windows\Installer directory is eating more of that space. I tried using msizap.exe to delete the unneeded files but I keep getting this error:

MsiZap V 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved

MsiZapInfo: Performing operations for user S-1-5-21-2700949330-2022528980-61785034-4992
Removing orphaned cached files.
   Error opening 66FC8F6438BA7A83992B5AEB05E74E27\InstallProperties subkey of Products key for S-1-5-18 user. Error: 2.
   Error opening 9AC087DE786021C34B9333962F4249F1\InstallProperties subkey of Products key for S-1-5-18 user. Error: 2.
FAILED to clear all data.

What can I do now?

Sambatyon

Posted 2012-09-19T07:32:20.763

Reputation: 353

Just had the same issue / figured out that the key in question is under HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\ SID \Products\ GUID \InstallProperties; where SID is the SID mentioned in the error (i.e. S-1-5-18), and GUID is the code from the error (e.g. 66FC8F6438BA7A83992B5AEB05E74E27). The issue is that the InstallProperties key doesn't exist (look at all the other entries). The question is...dare I create a blank on and rerun msizap... – JohnLBevan – 2019-08-29T17:20:35.573

Update: I exported the key, deleted it, then reran msizap g (and then reimported the reg file). The result was boringly pedestrian; the error was gone, but I got "no product/patch data was found. FYI: In my case the GUID was99E80CA9B0328e74791254777B1F42AE`; which Google says is the D365 CRM Outlook add-in. – JohnLBevan – 2019-08-29T17:29:25.943

contact your company's IT departement and have them do it – ratchet freak – 2012-09-19T08:04:04.283

Would love to, but as I know them, it will take three months before the solve the problem – Sambatyon – 2012-09-19T11:37:18.303

1Did you run MSIZAP as an administrator when you executed it? – CharlieRB – 2012-09-19T12:27:05.820

yes, all developers have administrator privileges in their computers – Sambatyon – 2012-09-20T10:51:27.537

Answers

0

Background

The error is caused because an expected registry path does not exist.

e.g. for the error: Error opening 66FC8F6438BA7A83992B5AEB05E74E27\InstallProperties subkey of Products key for S-1-5-18 user. Error: 2.

The error doesn't tell you the full registry key path; but does give you the SID of the user under whom the missing entry exists; in this case S-1-5-18 (i.e. the Local System account).

Looking in the registry under HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products (substituting S-1-5-18 with the relevant SID from the error, should it differ) we see a number of subkeys.

If we look under any of those subkeys we're likely to see another subkey, InstallProperties. However, for the subkey with the GUID from the error message, the InstallProperties subkey does not exist.

$userSid = 'S-1-5-18'
$productId = '66FC8F6438BA7A83992B5AEB05E74E27'
$path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData'
$path = Join-Path -Path $path -ChildPath $userSid
$path = Join-Path -Path $path -ChildPath 'Products'
$path = Join-Path -Path $path -ChildPath productId
Get-ChildItem -Path $path
# Note that InstallProperties is not listed

Workaround

This involves editing the registry, and is not based on any documented information... Use at your own risk / take sensible precautions such as backing up anything you care about before running.

  1. Open the registry editor (WinKey + R > Regedit > OK)
  2. Navigate to the appropriate product key entry; e.g. HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\66FC8F6438BA7A83992B5AEB05E74E27 for the above.
  3. Right click and select Export; so you're backing up this key's value.
  4. Delete this key
  5. (repeat the above for any other product keys with this error)
  6. Re-run msizap g. It should now run without error
  7. Double click the *.reg file you created in step 3 to reload that key into the registry

Hopefully now all's worked successfully, and nothing's been broken by the workaround... Good luck!

JohnLBevan

Posted 2012-09-19T07:32:20.763

Reputation: 357