How to detect the presence of the Visual C++ 2010 redistributable package
Question:
I have seen your previous blog posts that describe how to detect the presence of the Visual C++ 2005 redistributable package and the Visual C++ 2008 redistributable package. I am creating an installer that requires the Visual C++ 2010 runtime files. How can I detect the presence of the Visual C++ 2010 redistributable package?
Answer:
Unlike the Visual C++ 2005 and 2008 redistributable packages, there are registry keys that can be used to detect the presence of the Visual C++ 2010 redistributable package.
Visual C++ 2010 redistributable package detection registry values
- Visual C++ 2010 Redistributable Package (x86)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86]
Installed = 1 (REG_DWORD)
- Visual C++ 2010 Redistributable Package (x64)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64]
Installed = 1 (REG_DWORD)
- Visual C++ 2010 Redistributable Package (ia64)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\ia64]
Installed = 1 (REG_DWORD)
Alternatively, like in past releases of the Visual C++ redistributable package, you can use an algorithm like the one I described in my previous blog posts to detect the presence of the Visual C++ 2010 redistributable package on a system:
- Call the MsiQueryProductState API
- Pass in the product code for the package that you want to detect based on the list below
- Check the return value of this API. If it is anything other than INSTALLSTATE_DEFAULT, the package is not yet installed
Visual C++ 2010 redistributable package product codes
- Visual C++ 2010 Redistributable Package (x86) - {196BB40D-1578-3D01-B289-BEFC77A11A1E}
- Visual C++ 2010 Redistributable Package (x64) - {DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}
- Visual C++ 2010 Redistributable Package (ia64) - {C1A35166-4301-38E9-BA67-02823AD72A1B}
Visual C++ 2010 SP1 redistributable package product codes
- Visual C++ 2010 SP1 Redistributable Package (x86) - {F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
- Visual C++ 2010 SP1 Redistributable Package (x64) - {1D8E6291-B0D5-35EC-8441-6616F567A0F7}
- Visual C++ 2010 SP1 Redistributable Package (ia64) - {88C73C1C-2DE5-3B01-AFB8-B46EF4AB41CD}
PS:if you can not find the regist following these steps,then you can try this
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\Runtimes\x86
on 64-bit systems. In code that would result in accessing registry keyHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\Runtimes\x86
. Notice the absence of Wow6432Node
.
On a 32-bit system the registry is the same without Wow6432Node
:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\Runtimes\x86
最新文章
- Spring中常见的bean创建异常
- [Bootstrap-插件使用]Jcrop+fileinput组合实现头像上传功能
- thinkjs中自定义sql语句
- SQL多表查询案例
- 使用TCP协议的NAT穿透技术
- 酷摄影:关于梦 - Miki takahashi
- Linux网络配置命令ifconfig输出信息解析
- <;c>;----<;choose>;<;when>;<;otherwise>;
- [BJOI2019] 光线
- 移动端控制视频点击播放点击下一个视频时自动停止播放&;监听滑动溢出屏幕高度时停止播放
- Java设计模式之动态代理
- Oracle创建表空间创建用户和用户授权
- springboot 集成mybatis plus3
- Python Mysql_db对数据查询进行处理
- Python进行RSA安装加密
- RV32M指令集
- Codeforces Round #360 (Div. 2) D. Remainders Game 数学
- ORACLE ERP 的前世今生
- AJAX解惑篇(转)
- Xshell关闭导致jar服务终止,使Jar在CentOS后台运行
热门文章
- CSS:CSS cursor 属性
- nohup、&;、tail 在服务启动中的用法
- 1、css选择器
- c/c++面试39-44之内存动态分配
- 【网络爬虫】【python】网络爬虫(四):scrapy爬虫框架(架构、win/linux安装、文件结构)
- 【Linux学习】Linux文件系统4—Linux文件硬链接与软连接
- Flutter实战视频-移动电商-08.Dio基础_伪造请求头获取数据
- hoj2662 Pieces Assignment
- 分布式集群环境下,如何实现session共享五(spring-session+redis 实现session共享)
- plt