Apparently it works like this (On Windows 7, I do not know about XP and other OSes):
When a user installs some app, Windows does the following:
1) Creates a registry key
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[ProductId GUID]
for this app.
If you have access to the original msi file of installer of your app, you can find [ProductID GUID] by opening the msi file in orca.exe and clicking on the "Property" on the left in orca, and looking for "ProductCode" line on the right. If you do not have access to original *.msi file, you can just search registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall for the name of the app.
If you want to delete your app (which refuses to uninstall for example) from the list of installed apps in Control Panel, you can delete the entry from this Uninstall key. It will surely disappear from the list in control panel, but Windows will still remember it. For example, if you try to install a next version of the same app, Installer may still insist on uninstalling the previous version. See item 2 for that.
2) Windows copies the original *.msi file into the folder C:\Windows\Installer and renames it to a random name (keeps .msi extension though). Windows also creates a key in registry in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\[InternalUserId]\Products\[some random guid-like sequence of chars identifying to windows your installation]\InstallProperties.
ValueName "LocalPackage" in this reg key will point to the renamed msi file. To find the file in C:\windows\Installer you can navigate to this folder in Windows explorer, switch it into Details view, make column "Subject" visible and you will see for all nnnnnnnn.msi fies their corresponding name of product.
I gained access to another PC running Windows 7, a computer on which the context menu was intact. I peeked at the registry of this machine and copied exactly what was entered. Doing so resolved the problem on my desktop with the broken context menu.
Following all the instructions listed above, the two Strings within the .txt
key that I needed were Content Type
and PerceivedType
.
So then to recap, if you are facing a similar issue, here is what I did to fix this problem. Hopefully it works for you as well.
(First backup the Registry.)
- Open
regedit.exe
- Expand
HKEY_CLASSES_ROOT
and look for a .txt
key. If none exist, create one.
- Within the
.txt
key, create two new Strings: Content Type
and PerceivedType
.
- (Right click) Modify... and the value for
Default
should be txtfile
.
- (Right click) Modify... and the value for
Content Type
should be text/plain
.
- (Right click) Modify... and the value for
PerceivedType
should be text
.
- Create a new key with the name
ShellNew
within the .txt
key.
- Within the
ShellNew
key, create a new String with the name NullFile
.
- Within the
ShellNew
key, create a new Expandable String Value with the name ItemName
.
- (Right click) Modify... and the value for
ItemName
should be @%SystemRoot%\system32\notepad.exe,-470
Here are two screenshots of what the final outcome should be:
Best Answer
The article below shows different ways to delete unused Microsoft Installer/Patch files from the Installer folder. It is a very good and descriptive article.
3 Ways to Safely Delete Unused MSI and MSP Files from Windows Installer Folder
In summary, these are the 3 ways:
Use MsiZap (by Microsoft) This is an old Microsoft utility. Unfortunately not supported any more but still used by people. Because it is not supported any more you use this tool at your own risk. It can be found here.
Use a tool called WICleanup (by KZTechs) This is the option I used and it cleared 15Gb of data for me and I haven't had any problems since. There are a few notes I would add to the article on its use;
First, I had trouble with the download link, so I found the utility downloadable here.
Then, when deleting files using the UI you have to confirm each delete followed by a confirmation prompt. I.e. "Are you sure you want to delete? Yes/No?" followed by "The file has been deleted. OK". I had hundreds of files and this was not something I wanted to do for each.
The zip download has a UI executable and also a command line executable. To use the command line version, make sure you open a command prompt as administrator. Then navigate to where the exe is located and execute the following command
wicleanupc -s
The "s" makes the deletion of the files silent and no need to confirm.