19

How can I find the GUID of an MSI package? I would like to script the removal of a program on a large number of desktops by using:

msiexec.exe /x ProductCode

Any reason why this would not work for any applications listed in "Add/Remove Programs?"

SamErde
  • 3,324
  • 3
  • 23
  • 42
  • Just for the record: [**How can I find the product GUID of an installed MSI setup?**](http://stackoverflow.com/questions/29937568/how-can-i-find-the-product-guid-of-an-installed-msi-setup/29937569) (provided the setup is installed on the machine itself - if not get hold of **Orca** from the Windows SDK or [**another packaging tool**](http://stackoverflow.com/questions/1544292/what-installation-product-to-use-installshield-wix-wise-advanced-installer/1546941#1546941)). – Stein Åsmul Apr 30 '15 at 21:33

6 Answers6

18

UPDATE: Try this stackoverflow.com answer instead: How can I find the product GUID of an installed MSI setup? or even this one: Find GUID From MSI File .


The Windows SDK tool Orca will allow you to open and view all tables in an MSI file. Once you have the MSI open, you can either navigate to the Property table and look for the "product code" entry, or you can select "View => Summary Information..." and look for the "package code" entry. Either the package or the product guid can be used for uninstall.

See an Orca screenshot of how to find the product code in the MSI: WiX - Doing a major upgrade on a multi instance install

There are also other ways to find the GUID:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall

It still appears you have to download the MSI SDK to obtain Orca. If you don't have access to Orca and can't be bothered downloading the SDK, any viewer capable of reading a MSSQL database file (com stuctured storage file), should be able to open the MSI file and view the contents. Make a copy of the MSI before opening it in a viewer and open the copy. Just to be sure. Once open you navigate to the Property table and look for the product GUID.

UPDATE: A list of free MSI viewers (towards bottom).

Also check these posts on stackoverflow.com with information on how to uninstall via Powershell:

Stein Åsmul
  • 2,566
  • 4
  • 25
  • 38
  • It can be a real hassle to get hold of Orca.exe since it is only available as part of the SDK. If anyone is in a rush, I am happy to email you a copy. At the moment Microsoft seems to have put it available only in the full SDK: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . But as you know Microsoft changes things almost daily. – Stein Åsmul May 28 '11 at 14:48
  • The SDK is fairly simple to get as well...but you do have to download more. A search can also turn up other MSI editors, such as InstEdit. – SamErde May 28 '11 at 15:02
  • You can use SuperOrca instead of Orca. Does the same thing and is much easier to catch. – Chris Grimmett Jul 14 '17 at 20:27
  • Since `HKEY_CLASSES_ROOT` ist a merge of `HKLM:\SOFTWARE\Classes` and `HKCU:\SOFTWARE\Classes` the `HKEY_CLASSES_ROOT\Installer\Products` resides actually in `HKLM:\SOFTWARE\Classes\Installer\Products` resp. maybe its `HKCU` counterpart. – TNT Jun 19 '18 at 18:31
7

It is a registry key:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{<guid>}

or if the platform is x64 and the application is 32-bit:

HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{<guid>}
Greg Askew
  • 34,339
  • 3
  • 52
  • 81
3

There is also a very helpful GUI tool called Product Browser which appears to be made by Microsoft or at least an employee of Microsoft.

It can be found on Github here Product Browser

The latest version as of (10/9/20) is available here

I personally had a very easy time locating the GUID I needed with this.

Grimbly
  • 31
  • 1
3

A light-weight freeware tool like InstEd can be used. Just open the MSI, on the "Tables" tab, click on "Property" on the left, then on the right, locate "ProductCode".

Bryan Vine
  • 31
  • 1
2

In Powershell you can query wmi for installations

$program = Get-WmiObject -class Win32_Product | ? {$_.Name -eq "Java Auto Updater"} 
$program.IdentifyingNumber #IdentifyingNumber is the guid

example to repair

msiexec /fa $program.IdentifyingNumber
Aussie Ash
  • 176
  • 4
1

Revision Number Summary Property:

[T]he Revision Number Summary property lists the product code GUIDs [...]

medina
  • 1,970
  • 10
  • 7