How to find the ProductCode GUID of an installed MSI

Written by Horatiu Vladasel · June 23rd, 2022 · 4min read

A ProductCode is made up of string GUIDs containing numbers and uppercase letters.

Since this code is specific to each Windows Installer package, you can't install two software products with the same ProductCode on the same machine – if that happens, you will get the following error message:

Software Already Installer Error

In this article, we will show you a few ways to find your ProductCode whenever you need it. Let's start with the ProductCode Property within the MSI.

How to find the ProductCode Property within the MSI

If you have access to the MSI, then probably the easiest way to find the ProductCode is by opening an MSI editor tool and heading to the Property table.

There, you will find the ProductCode property, which gives you the unique identifier of that Windows Installer package.

ProductCode Property

How to find the ProductCode using Uninstall Registry keys

We also have the option to find the ProductCode of a software product by going to the Uninstall Registry keys and searching for it. It may not be the most simple thing, so let's see how we can achieve that.

Uninstall Registry Keys

The Uninstall Registry keys could be located under one of the following registry hives:

x64 bit installer, per-machine based installation

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

x86 bit installer, per-machine based installation

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

x64 bit installer, per-user based installation

HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall 

x86 bit installer, per-user based installation

HKCU\SOFTWARE\ WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

You will find the details of the software product stored in a subkey of the above registry hives – identified by the ProductCode.

Finding the ProductCode with VBScript

WiLstPrd.vbs is a VBScript file provided in the Windows SDK Components for Windows Installer Developers.

It uses an Installer object to retrieve the registered products and product information on the local device.

WiLstPrd.vbs Script

To retrieve the ProductCode of a specific software product, you need to run the following command line from a command prompt:

cscript "WiLstPrd.vbs" <ProductName> | findstr ProductCode
Retrieve ProductCode with VBScript

How to Use PowerShell to Find the ProductCode?

All Windows Installer packages, and their related information, can be accessed through Windows Management Instrumentation (WMI)’s Win32_Product class via PowerShell.

Win32_Product

In the example above, we formatted the output as a table with the selected properties of the object in each column:

  • IdentifyingNumber – represents the ProductCode
  • Name – represents the ProductName

To retrieve the ProductCode of a specific software, you need to run the following command:

Get-WmiObject Win32_Product | Where Name -eq '<ProductName>' |Format-Table IdentifyingNumber, Name
Retrieve ProductCode Using Powershell

NoteBoth VBScript and PowerShell commands should be executed with administrative permissions.

TipMaster all you need to know about MSI with the MSI Packaging Training eBook. Haven't read it yet? Grab your free copy now.

Conclusion

And there you go! Now you have a few options to find the ProductCode GUID of your installed MSI setup whenever you need it.

We hope you found this article useful! Let us know if you have any questions.

Video

FAQ: How to find the ProductCode GUID of an installed MSI

What is the ProductCode in an MSI package, and why is it important?

The ProductCode is a unique identifier (GUID) assigned to each Windows Installer (MSI) package. It makes a product unique and is crucial for the installation, maintenance, and uninstallation processes. Having duplicate ProductCodes on the same machine can lead to installation errors, as Windows Installer uses this code to manage installed products.

How can I find the ProductCode if I have access to the original MSI file?

If you have the MSI file, you can use an MSI editor tool to open it and navigate to the Property table. Within this table, you'll find the ProductCode property, which contains the unique identifier for that installer package.

Can I retrieve the ProductCode from the Windows Registry?

Yes, you can find the ProductCode by looking at the Uninstall registry keys. Depending on the installation context (per-machine or per-user) and system architecture (32-bit or 64-bit), the relevant registry paths are: For 64-bit installers, per-user and per-machine installations: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

For 32-bit installers on a 64-bit system, per-user and per-machine installations: HKEY_CURRENT_USER\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Within these paths, you'll find subkeys named after the ProductCode GUIDs.

Is it possible to use PowerShell to retrieve the ProductCode of an installed application?

Yes, PowerShell can be utilized to retrieve the ProductCode using Windows Management Instrumentation (WMI). Here's how you can do it:Get-WmiObject Win32_Product | Where-Object { $_.Name -eq 'YourProductName' } | Format-Table IdentifyingNumber, Name

Replace 'YourProductName' with the actual name of the installed application. The IdentifyingNumber field in the output corresponds to the ProductCode.

Subscribe to Our Newsletter

Sign up for free and be the first to receive the latest news, videos, exclusive How-Tos, and guides from Advanced Installer.

Comments: