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
- 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.
- Upgrading Software: During an upgrade, the installer may need to reference the product code to determine which version of the software is currently installed.
- 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:
- Open the Registry Editor and Navigate to the Uninstall Key:
- 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.
- In the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
For 64-bit applications on a 64-bit system, navigate to:
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:
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:
- Install Orca:
- Orca is part of the Windows SDK. Download and install the SDK, and then install the Orca tool.
- Open the MSI File:
- Launch Orca and open the MSI file you want to inspect.
- Find the Product Code:
- In Orca, navigate to the
Property
table. Look for theProductCode
property, which will list the product code for that MSI.
- In Orca, navigate to the