How to Find Product Codes in MSI

When managing or deploying software installations, particularly for enterprise environments, finding the product code for an MSI (Microsoft Installer) application can be essential. The product code is a unique identifier for an installed application, often required for tasks such as silent uninstallation, upgrades, or detailed software audits.

What is a Product Code?

A product code is a globally unique identifier (GUID) used by the Windows Installer to manage installed applications. It’s a 32-character string separated by dashes into five groups, like this:

{12345678-ABCD-1234-EFGH-567890ABCDEF}

This code allows Windows Installer to uniquely identify each installed product and perform specific actions such as repairs, upgrades, and uninstallations.

Why You Might Need the Product Code

  1. Silent Uninstallation: When deploying software across multiple systems, IT administrators often require a silent uninstall to remove applications without user intervention. The product code is crucial in this process.
  2. Upgrading Software: During an upgrade, the installer may need to reference the product code to determine which version of the software is currently installed.
  3. Troubleshooting Installation Issues: Knowing the product code can help diagnose issues related to application installations or conflicts.

Finding the Product Code Using the Registry

One of the most reliable methods to find the product code is through the Windows Registry. Here’s how you can locate it:

  1. Open the Registry Editor and Navigate to the Uninstall Key:
  2. Search for the Application:
    • In the Uninstall key, you’ll find several subkeys with long alphanumeric GUIDs. Each of these corresponds to an installed application.
    • Click through each GUID to find the application you are looking for. The DisplayName value in each subkey will tell you the name of the application.
    • Once you’ve located the correct subkey for the application, the GUID of that subkey is the product code.
Plaintext
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

For 64-bit applications on a 64-bit system, navigate to:

Plaintext
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Using PowerShell to Find the Product Code

For those who prefer a command-line approach, PowerShell provides a powerful way to extract the product code:

PowerShell
Get-WmiObject -Query 'SELECT * FROM Win32_Product' | Select-Object -Property Name, IdentifyingNumber, Version, Vendor

This command will display the application names alongside their product codes and versions, making it easier to find the one you need. When I am preparing installations of apps that I am not familiar with I usually publish the app and install it. Set C:\temp\tmp.tmp as detection mode the once installed I run the above command to get the msi code and change the detection to MSI.

Using Orca to Find the Product Code

Orca is a tool from the Windows SDK that allows you to inspect and edit MSI files directly. Here’s how to find the product code using Orca:

  1. Install Orca:
    • Orca is part of the Windows SDK. Download and install the SDK, and then install the Orca tool.
  2. Open the MSI File:
    • Launch Orca and open the MSI file you want to inspect.
  3. Find the Product Code:
    • In Orca, navigate to the Property table. Look for the ProductCode property, which will list the product code for that MSI.

Leave a Reply

Your email address will not be published. Required fields are marked *