17

I have to replace it because of a bug that blocks the software uninstallation, but Windows can't find the MSI file if I use the file search utility, but I think the MSI is stored somewhere where the Add or Remove Programs utility can use it.

Jader Dias
  • 88,211
  • 155
  • 421
  • 625
  • The recommended / **correct way** to fix uninstall problems is to **use a minor upgrade to "hotfix" the installed product, and then trigger its fixed uninstall sequence** as indicated below by **saschabeaumont**. The minor upgrade can be delivered as a regular MSI or as a patch package (for huge products). – Stein Åsmul Feb 16 '18 at 13:28
  • [**Adding this answer as well**](https://stackoverflow.com/a/9709964/129130) for future reference. – Stein Åsmul Jun 29 '18 at 17:01
  • [Adding this old answer on installers and caching](https://stackoverflow.com/a/48823086/129130). There is a whole lot of caching going on. – Stein Åsmul Mar 02 '23 at 01:21

8 Answers8

19

Does it not go into %windir%\installer\?

Though I think that the files may get renamed. Not sure where you get the name mapping from...

This directory gets very big so I move it to an external drive. This sometimes cause uninstalls or updates to fail with a missing msi error, but this can be fixed by putting the directory back.

Josh Correia
  • 3,807
  • 3
  • 33
  • 50
Sam Holder
  • 32,535
  • 13
  • 101
  • 181
19

InstallShield creates a copy of all Microsoft Installer (MSI) files at %windir%\installer\ path. Here %windir% is an environment variable which points to the location of Windows installation directory. Typically it is C:\Windows. Before creating a copy of any MSI file it renames it using some random nomenclature e.g. I can see a file named 65ec5c99.msi in C:\Windows\Installer directory on my machine.

Now there are two ways to figure out the actual product name for the renamed MSI file:

  1. Check LocalPackage attribute inside registry at below path:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersio‌​n\Installer\UserData‌​\<InternalUserId>\Pr‌​oducts\<ProductGUID>‌​\InstallProperties
    

    InternalUserId in above registry path is a string like S-1-5-18. Similarly, ProductGUID is a GUID string like 00058CD18F0BF523DA1072073D56715D. This GUID is embedded inside the MSI file itself as a public property. You can get the value of this public property by opening the MSI file using any utility or tool like Orca

  2. Open C:\Windows\Installer folder in explorer. Change the view of the directory to Details view (Refer screenshot):

    enter image description here

    Add Subject column to the view. Now product name of every MSI in that folder will be visible under Subject column (Refer screenshot):

    enter image description here

Note: The C:\Windows\installer path mentioned in point # 2 above is a hidden directory. So it is not visible in explorer by default. To make it visible, go to View tab in explorer > Click on Options dropdown button > Click on Change folder and search options (Refer screenshot):

enter image description here

This will open Folder Options dialog box (Refer screenshot) > Click on View tab > Now make below changes:

  • Check Show hidden files, folders, and drives option button
  • Uncheck Hide protected operating system files(Recommended) checkbox

enter image description here

RBT
  • 24,161
  • 21
  • 159
  • 240
  • 1
    If anyone with windows setting to german is trying to display the 'Subject' column in explorer: activate 'Betreff' – Michael W. Apr 14 '21 at 08:12
8

You can force a recache/reinstall using with MSIEXEC, the recommended way to update buggy installation packages that cannot be otherwise removed is to recache with a fixed package, then uninstall as usual.

MSIEXEC /fv setup.msi
saschabeaumont
  • 22,080
  • 4
  • 63
  • 85
6

To see useful names of msi files in C:\Windows\Installer right click at the top of explorer and add the field to view Subject (will probably have to select more as it isn't a default like name, date modified, etc.) From here you can find the msi and use it to uninstall programs.

thrax
  • 61
  • 1
  • 4
5

When you install a package using the Windows Installer service, the msi file does get cached in the hidden folder "%windir%\installer". It does get renamed, and the new name is a hex string that doesn't have an obvious correlation to the original name. Something like "123ab4.msi".

It's not hard to figure out which one is the cached copy of your app. The quickest way is to look for the cached file that's the same size. When you think you've found it, hover your pointer over the file's name in Windows Explorer. The tooltip will come up, and it will show you the data from the summary information stream of the package. Product name, author name, and so on. Once you've found the right file, you can directly edit it with a tool like Orca.

If you're just trying to fix things on your own machine, then directly editing the cached database may be a good option. However, Microsoft does provide a built-in way to handle a problem like this. You can create a patch (an msp file), which contains the difference between the original msi file and your updated msi file. That patch could then be distributed to anyone else that has already installed your app using the original install, and it would be easy to use.

MSDN discusses patch creation here - http://msdn.microsoft.com/en-us/library/aa368060%28VS.85%29.aspx

Deleting the hidden folder generally isn't a good idea, as that breaks some core functionality of the Installer service. That includes patching, detect and repair, and the ability to upgrade via migration rather than uninstalling and reinstalling.

Ed.
  • 1,172
  • 6
  • 9
  • This is a very old answer, looking for the exact match for correlation is hard because you may not have the original MSI and even downloading one after you fish it may be impossible. The other answers suggest adding the subject line to explorer which seems easier and more conducive to finding the package the renamed MSI refers to. – luv2learn Oct 12 '22 at 23:14
1

The MSI files do get renamed. They are found in %windir%\installer. I know that has been answered, but I wanted to include a script to help find them with the application name.

Here is a pwsh script to resolve the renamed MSI to the application display name.

$loc = Get-ChildItem -Recurse HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\
$loc | ForEach-Object { Get-ItemProperty $_.PsPath } | Where LocalPackage -ne $null |  Sort DisplayName | Select DisplayName,LocalPackage
Joe
  • 11
  • 2
0

One more way:

  1. in "Control panel" - "Programs and components" find the program,
  2. click on Change
  3. (Before closing the Installation wizzard) in Process explorer find by "\installer"

enter image description here

Mikhail V.
  • 75
  • 8
-1

Maybe the msi has simply been deleted. You can delete the installation folder and run the msi cleanup utility and then reinstall your program.

Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222
  • 1
    MSIZAP (Windows Installer Cleanup) is a very dangerous tool. See http://robmensching.com/blog/posts/2009/3/6/More-on-Haacks-Troubleshooting-Windows-MSI-Installers for more information – saschabeaumont Jan 17 '10 at 23:30