I have an application installed on my machine. I also have its source code but somehow the ProductCode and UpgradeCode of this application were changed.
Now I want to get the UpgradeCode and ProductCode of this installed application. I feel there must be some tool for this.
Can anyone kindly let me know how to get the UpgradeCode and ProductCode of an installed application?
open system registry and search for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall key (if it's a 32-bit installer on a 64-bit machine, it might be under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall instead).
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.
The package code is a GUID identifying a particular Windows Installer package. The package code associates an . msi file with an application or product and can also be used for the verification of sources. The product and package codes are not interchangeable.
IMPORTANT: It's been a while since this answer was originally posted, and smart people came up with wiser answers. Check How can I find the Upgrade Code for an installed MSI file? from @ Stein Åsmul if you need a solid and comprehensive approach.
Here's another way (you don't need any tools):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
key (if it's a 32-bit installer on a 64-bit machine, it might be under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
instead).This GUID you stopped on is the ProductCode.
Now, if you're sure that reinstallation of this application will go fine, you can run the following command line:
msiexec /i {PRODUCT-CODE-GUID-HERE} REINSTALL=ALL REINSTALLMODE=omus /l*v log.txt
This will "repair" your application. Now look at the log file and search for "UpgradeCode". This value is dumped there.
NOTE: you should only do this if you are sure that reinstall flow is implemented correctly and this won't break your installed application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With