如何检测是否安装了 Visual C++ 2017 Redistributable [英] How to detect if Visual C++ 2017 Redistributable is installed

查看:271
本文介绍了如何检测是否安装了 Visual C++ 2017 Redistributable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着 Microsoft 在其最新版本中更改注册表项的模式,我如何检测机器上是否安装了 Visual C++ 2017 Redistributable?

With Microsoft changing the pattern of registry entries in its latest versions, how do i detect if Visual C++ 2017 Redistributable is installed on a machine?

我的目标是安装 VC++2015Redist,因为该软件是使用 VS2015 编写的.如果我可以在一台机器上成功检测到 VC++2017Redist,那么我就跳过我的 VC++2015Redist 安装

My aim is to install VC++2015Redist since the software is written using VS2015. If i can successfully detect VC++2017Redist on a machine, then I skip my installation of VC++2015Redist

推荐答案

2017 VC++ Redistributable 安装升级/替换 2015 安装

Visual Studio 2017 Redistributables 的安装会升级并替换 2015 Redistributables 的任何现有安装.我已经检查过了,2015 年的安装从添加/删除程序"中消失了,并且注册表值(见下文)更新了它们的版本号.此外,per MSDN,2017 VC++ Redistributables 与 2015 版本具有二进制兼容性.

The 2017 VC++ Redistributable installation upgrades/REPLACES the 2015 installation

Installation of the Visual Studio 2017 Redistributables upgrades and replaces any existing installation of the 2015 Redistributables. I've checked this, and the 2015 installation disappears from "Add/Remove Programs", and the registry values (see below) have their version numbers updated. Further, per MSDN, the 2017 VC++ Redistributables have Binary Compatibility with the 2015 version.

可以通过检查下面描述的注册表项来检查是否安装了 2015 或 2017.这是针对 x64 系统的,看看没有 Wow6432Node 的 32 位系统.

It's possible to check whether 2015 or 2017 are installed by checking the registry keys described below. This is for a x64 system, have a look without the Wow6432Node for a 32-bit system.

对于 64 位 VC++ Redistributable

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftVisualStudio14.0VCRuntimesx64

对于 32 位 VC++ Redistributable

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftVisualStudio14.0VCRuntimesx86

32 位和 64 位安装的属性和值相同(相同格式).注册表使用价值:

The properties and values are the same (same format) for both 32- and 64-bit installations. Registry Values of use:

Value          2015       2017 
Name      Val. Data  Val. Data
--------  ---------  ---------
Major            14         14
Minor             0         13
Bld           23026      26020

请注意,2017 年的@Minor 和内部版本 (@Bld) 编号会随着新补丁的更新而不断变化.

Note that the @Minor and build (@Bld) numbers of 2017 continue to change as new patches are updated.

我建议,如果检查安装的最低版本为 2015,只需检查密钥并且@Major 版本为 14.

I would suggest, if checking for a minimum that 2015 is installed, just checking the key and that the @Major version is 14.

如果检查2017,如果它不存在,则打算进行升级,那么只需检查@Bld编号,如果不是至少可以安装的版本,则继续安装当前的2017版本.请注意,未来可能会更新 @Minor 和 @Bld 版本——我有另一台安装了 v14.11.25325 的计算机,也是 2017 版本.

If checking for 2017, with the intention of doing an upgrade if it's not in existence, then just check the @Bld number, and if it's not at least the version that can be installed, then go ahead and install the current 2017 version. Note that future updates the the @Minor and @Bld version are probable -- I've got another computer where v14.11.25325 is installed, also a 2017 version.

这篇关于如何检测是否安装了 Visual C++ 2017 Redistributable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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