如何在 Windows 7 中查找已安装应用程序的 UpgradeCode 和 ProductCode [英] How to find the UpgradeCode and ProductCode of an installed application in Windows 7
问题描述
我的机器上安装了一个应用程序.我也有它的源代码,但不知何故更改了这个应用程序的 ProductCode 和 UpgradeCode.
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.
现在我想获取这个已安装应用程序的 UpgradeCode 和 ProductCode.我觉得必须有一些工具可以做到这一点.
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?
推荐答案
重要:这个答案最初发布已经有一段时间了,聪明的人想出了更明智的答案.检查 我怎样才能找到已安装 MSI 文件的升级代码?来自 @ Stein Åsmul 如果您需要可靠而全面的方法.
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_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall
键(如果它是 64 位机器上的 32 位安装程序,它可能位于HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall
代替). - 该键下列出的 GUID 是安装在这台机器上的产品
- 找到您正在谈论的那个 - 只需一步一步,直到您在右侧窗格中看到它的名称
- 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 underHKEY_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
您停止的这个 GUID 是产品代码.
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}重新安装=全部重新安装模式=omus/l*v日志.txt
msiexec /i {PRODUCT-CODE-GUID-HERE} REINSTALL=ALL REINSTALLMODE=omus /l*v log.txt
这将修复"您的应用程序.现在查看日志文件并搜索UpgradeCode".这个值被转储到那里.
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.
这篇关于如何在 Windows 7 中查找已安装应用程序的 UpgradeCode 和 ProductCode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!