安装过程中生成的 GUID 对于 XP 和 Windows 7 是否通用?

发布于 2024-08-19 19:13:17 字数 691 浏览 2 评论 0原文

这个问题是关于我正在编写的安装/卸载框架。对于卸载,我使用以下机制: msiexec /X {GUID} 其中 GUID 是在注册表配置单元的卸载位置生成的注册表项:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall。

对于其中一个软件,当我安装 Microsoft Visual C++ 2008 SP1 Redistributable 时,它​​会在 XP 中生成 GUID {9A25302D-30C0-39D9-BD6F-21E6EC160475}。

但是,同一软件在 Windows 7 中生成的 GUID 为 {1F1C2DFC-2D24-3E06-BCB8-725134ADF989}。

如果我卸载该软件并在 XP 和 Windows 7 中重新安装它,我会一次又一次地获得上述相同的 GUID。

那么为什么 XP 和 Windows 7 的 GUID 不同呢? 我能否确定它在给定的操作系统上是相同的(即在 XP for VC++ 2008 SP1 Redist 中它始终是 {9A25302D-30C0-39D9-BD6F-21E6EC160475}。)? Windows 使用什么机制生成这些 GUID(在这种情况下 XP 和 Windows 7 不同)?

还有一些其他软件(如 Acrobat、RealVNC 等)的 GUID 对于 Windows 7 和 XP 是相同的。

This question is about an installation/uninstallation framework i am writing. For uninstallation i use the following mechanism:
msiexec /X {GUID} where GUID is the registrykey that is generated in the uninstall location of the registry hive : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

For one of the softwares, when i install Microsoft Visual C++ 2008 SP1 Redistributable it generates a GUID {9A25302D-30C0-39D9-BD6F-21E6EC160475} in XP.

However the same software generates a GUID of {1F1C2DFC-2D24-3E06-BCB8-725134ADF989} in Windows 7.

If I uninstall the software and reinstall it in XP and Windows 7 i get the same above mentioned GUIDs again and again.

So why is the GUID different for XP and Windows 7?
Can I be sure that it will be the same on a given operating System (i.e it will always be {9A25302D-30C0-39D9-BD6F-21E6EC160475} in XP for VC++ 2008 SP1 Redist.) ?
What is the mechanism that Windows uses to generate these GUIDs (different for XP and Windows 7 in this case).?

There are a few other softwares(like Acrobat, RealVNC, etc) where the GUID is the same for Windows 7 and XP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枫林﹌晚霞¤ 2024-08-26 19:13:17

大多数对不同版本的 Windows 使用相同设置的应用程序将在注册表配置单元中具有相同的 guid。

虽然某些应用程序通过查找 Windows 版本来使用条件安装...结果 GUID 在注册表配置单元中会有所不同。即使两个 Windows 安装程序相同,这也可能有效,安装程序可以根据 Windows 版本等条件在主设置中运行不同的设置...

Most applications that use same setup for different versions of windows will have same guid at registry hive.

While some applications use conditional installing by looking up into windows version... in result GUIDs will be different in registry hive. this may work even both windows installer is same, installer can run different setups inside main setup by conditions like windows version, etc...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文