Follow

Error: Uninstall an MSI and msiexec fails asking for path of old MSI

 

Symptom:

Upon installing a new version of software it is possible to get an MSI error that asks you for the original path of the MSI

Cause:

Directories or paths to the old MSI has been altered

Resolution:

Provide your old MSI file

Option 1. Locate your old MSI and browse to it

  • Browse to the original MSI
  • When an MSI is run it is loaded into %WINDOWS%\Installer folder but the random name may make it difficult to find

Option 2. Uninstall the program without using the MSI.

  1. Locate your Product Code that you are trying to install
    • In the registry go to HKEY_CURRENT_USER\Software\Microsoft\Installer
    • or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData registry keys
  2. From a command prompt run msiexec /x [ProductCode]

This should uninstall your application.

More Info:

1. Using the original MSI

  • If you have access to the original MSI used for the installation, you can simply right click it in Windows Explorer and select Uninstall.
  • As stated above you can do the same by command line: msiexec /x filename.msi /q

2. Using the ARP (Add/Remove Programs) Applet

  • Just got to mention the normal approach though it is obvious
  • Go start -> run -> appwiz.cpl -> ENTER in order to open the add/remove programs applet (or click add/ remove programs in the control panel)
  • Click "Remove" for the product you want to uninstall.

3. Using msiexec.exe command line

  • You can locate the required GUID to pass to msiexec.exe /x by opening regedit.exe at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and search for the application name (or just browse through each sub folder till u find it).
  • When you have found it you can pass it to msiexec as explained above: msiexec.exe /x {0077A7C7-3333-2222-1111-111111111000}
  • More information on this serverfault.com post and this stackoverflow post

NB: These registry paths are not up to date for 64-bit windows. I will update as soon as I can verify, or someone else update it please.


4. Using the cached MSI database in the super hidden cache folder

  • MSI strips out all cabs (older Windows versions) and caches each MSI installed in a super hidden system folder at %SystemRoot%\Installer (you need to show hidden files to see it).
  • All the MSI files here will have a random name assigned, but you can get information about each MSI by showing the Windows Explorer status bar (View -> Status Bar) and then selecting an MSI. The summary stream from the MSI will be visible at the bottom of the Windows Explorer window. Or as Christopher Galpin points out, turn on the "Comments" column in Windows Explorer and select the MSI file.
  • Once you find the right MSI, just right click it and go Uninstall.

NB: This supper hidden folder is now being treated differently in Windows 7 onwards. MSI files are now cached full-size. Read the linked thread for more details - recommended read for anyone who finds this answer and fiddles with dangerous Windows settings.


5. Using PowerShell

    $app = Get-WmiObject -Class Win32_Product -Filter "Name = 'YOUR_APP'"
    $app.Uninstall()
  • Entry added by Even Mien
  • More Powershell information here
  • I have not tested this myself, but it appears $app.Uninstall() may run the UninstallString registered in the ARP applet's registry settings. This means it may run modify instead of uninstall in some cases.
Was this article helpful?
0 out of 0 found this helpful

Comments