Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
877 views
in Technique[技术] by (71.8m points)

automation - How to find the UpgradeCode and ProductCode of an installed application in Windows 7

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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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):

  • open system registry and search for HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall key (if it's a 32-bit installer on a 64-bit machine, it might be under HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall instead).
  • the GUIDs listed under that key are the products installed on this machine
  • find the one you're talking about - just step one by one until you see its name on the right pane

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...