如何可靠地检测实际安装的 .NET 4.5 版本? [英] How to reliably detect the actual .NET 4.5 version installed?

查看:29
本文介绍了如何可靠地检测实际安装的 .NET 4.5 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的实际问题是我遇到了两个版本的 .NET 4.5 完整设置:

My actual problem is that I have encountered two versions of .NET 4.5 full setups:

  • 一个(可能)较旧的,下载 SQL Server Data Tools 时也可以使用
    • 尺寸:50,349,920
    • md5:a5e81d1b3905ada0a6e35fd6c6a2e1f4
    • 尺寸:50,352,408
    • md5:d02dc8b69a702a47c083278938c4d2f1

    这两种设置的版本都是 4.5.50709.17929.在里面,主要的区别是 netfx_Full.mzz 文件,但是用 7-zip 提取内容后,我最终得到了很多相同版本的文件,即使文件内容不同(我已经检查了大约 426 个中的大约 20 个随机文件),所以我真的无法分辨哪个是更新的.

    The version for both setups is 4.5.50709.17929. Inside, the main difference is the netfx_Full.mzz file, but after extracting the content with 7-zip I end up with a lot of files with the same version, even if the file content is different (I have checked about 20 random files from about 426), so I can't really tell which one is newer.

    有没有办法可靠地检测已安装的 .NET 4.5 运行时的实际版本,以便我仅在确实需要时才可以运行安装程序?

    Is there a way to reliably detect the actual version of the installed .NET 4.5 runtime, so I can run the setup only if it's really required?

    更新

    我检查了所有具有不同内容的 426 个文件,并且所有这些文件在两种设置中都具有相同的 ProductVersion 和 FileVersion.因此,下一步是注册表或文件校验和.

    I have checked all the 426 files that have different content, and all of them are having the same ProductVersion and FileVersion in both setups. So, registry or file checksums are the next step.

    更新 2

    注册表中列出的版本对于两种设置都是相同的:4.5.50709

    The version listed in the registry is the same for both setups: 4.5.50709

    更新 3

    .NET 4.5.2 现已推出:

    此版本的 .NET Framework 与 .NET Framework 3.5 SP1 及更早版本并行运行,但对 .NET Framework 4、.NET Framework 4.5 和 .NET Framework 4.5 执行就地更新.1.

    This version of the .NET Framework runs side-by-side with the .NET Framework 3.5 SP1 and earlier versions, but performs an in-place update for the .NET Framework 4, .NET Framework 4.5 and .NET Framework 4.5.1.

    推荐答案

    MS 最近修补了 .NET 4.5 以在某些情况下恢复与 .NET 4.0 的向后兼容性(请参阅 http://blogs.msdn.com/b/dotnet/archive/2012/10/17/net-framework-4-5-off-to-a-great-start.aspx).

    MS recently patched .NET 4.5 to restore backwards compatibility with .NET 4.0 in some scenarios (see http://blogs.msdn.com/b/dotnet/archive/2012/10/17/net-framework-4-5-off-to-a-great-start.aspx).

    MS 可能使用这些更改更新了设置(以便升级到 .NET 4.5 的用户不会遇到兼容问题),但我不知道他们为什么不更改设置中的版本号.

    It's possible that MS updated the setup with these changes (so that users upgrading to .NET 4.5 don't run into compat trouble), though I don't know why they wouldn't change the version number on the setup.

    另外,请注意 System.Environment.Version 报告的 .NET 版本号和运行时版本号之间存在差异.对于 .NET 4.5,后者仍然是 4.0.30319.*,只是修订号发生了变化(随着 .NET 4.5 更新以及每个安全更新).

    Also, note that there's a difference between the .NET version number and the runtime version number as reported by System.Environment.Version. The latter still is 4.0.30319.* for .NET 4.5, only the revision number changes (with the .NET 4.5 update, and also with every security update).

    以下是一些在野外观察到的运行时版本示例:

    Here are some examples of runtime versions observed in the wild:

    基础 4.0

    • 4.0.30319.1 = .NET 4.0 RTM
    • 4.0.30319.269 = Windows XP SP3、7、7 SP1 上的 .NET 4.0(带有 MS12-035 GDR 安全更新)
    • 4.0.30319.276 = Windows XP SP3 上的 .NET 4.0(4.0.3 运行时更新)
    • 4.0.30319.296 = Windows XP SP3、7 上的 .NET 4.0(使用 MS12-074 GDR 安全更新)
    • 4.0.30319.544 = Windows XP SP3、7、7 SP1 上的 .NET 4.0(带有 MS12-035 LDR 安全更新)
    • 4.0.30319.1008 = Windows XP SP3、7、7 SP1 上的 .NET 4.0(带有 MS13-052 GDR 安全更新)
    • 4.0.30319.1022 = Windows XP SP3、7、7 SP1 上的 .NET 4.0(带有 MS14-009 GDR 安全更新)
    • 4.0.30319.1026 = Windows XP SP3、7、7 SP1 上的 .NET 4.0(带有 MS14-057 GDR 安全更新)
    • 4.0.30319.2034 = Windows XP SP3、7、7 SP1 上的 .NET 4.0(带有 MS14-009 LDR 安全更新)
    • 4.0.30319.1 = .NET 4.0 RTM
    • 4.0.30319.269 = .NET 4.0 on Windows XP SP3, 7, 7 SP1 (with MS12-035 GDR security update)
    • 4.0.30319.276 = .NET 4.0 on Windows XP SP3 (4.0.3 Runtime update)
    • 4.0.30319.296 = .NET 4.0 on Windows XP SP3, 7 (with MS12-074 GDR security update)
    • 4.0.30319.544 = .NET 4.0 on Windows XP SP3, 7, 7 SP1 (with MS12-035 LDR security update)
    • 4.0.30319.1008 = .NET 4.0 on Windows XP SP3, 7, 7 SP1 (with MS13-052 GDR security update)
    • 4.0.30319.1022 = .NET 4.0 on Windows XP SP3, 7, 7 SP1 (with MS14-009 GDR security update)
    • 4.0.30319.1026 = .NET 4.0 on Windows XP SP3, 7, 7 SP1 (with MS14-057 GDR security update)
    • 4.0.30319.2034 = .NET 4.0 on Windows XP SP3, 7, 7 SP1 (with MS14-009 LDR security update)

    4.5

    • 4.0.30319.17626 = .NET 4.5 RC
    • 4.0.30319.17929 = .NET 4.5 RTM
    • 4.0.30319.18010 = Windows 8 上的 .NET 4.5
    • 4.0.30319.18052 = Windows 7 SP1 64 位上的 .NET 4.5
    • 4.0.30319.18063 = .NET 4.5 在 Windows 7 SP1 64 位(带有 MS14-009 安全更新)
    • 4.0.30319.17626 = .NET 4.5 RC
    • 4.0.30319.17929 = .NET 4.5 RTM
    • 4.0.30319.18010 = .NET 4.5 on Windows 8
    • 4.0.30319.18052 = .NET 4.5 on Windows 7 SP1 64-bit
    • 4.0.30319.18063 = .NET 4.5 on Windows 7 SP1 64-bit (with MS14-009 security update)

    4.5.1

    • 4.0.30319.18408 = .NET 4.5.1(Windows 7 SP1 64 位)
    • 4.0.30319.18444 = .NET 4.5.1,Windows 7 SP1 64 位(带有 MS14-009 安全更新)
    • 4.0.30319.34014 = Windows 8.1 64 位上的 .NET 4.5.1

    4.5.2

    • 4.0.30319.34209 = Windows 7 SP1 64 位上的 .NET 4.5.2
    • 4.0.30319.34209 = .NET 4.5.2(64 位 Windows 8.1)

    4.6 及更高版本

    • 4.0.30319.42000

    我在 Windows 更新历史记录中没有看到任何 .NET 更新,所以我猜 v18010 的更新是作为 知识库文章 2756872.

    I don't see any .NET updates in my Windows Update history, so I guess the update to v18010 got installed as part of KB 2756872.

    更新:显然,由于原始下载中的数字签名存在错误,Microsoft 更新了 .NET 4.5 设置.KB 2770445.

    Update: apparently Microsoft updated the .NET 4.5 setup due a mistake with the digital signatures in the original download. KB 2770445.

    这篇关于如何可靠地检测实际安装的 .NET 4.5 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆