询问者
怎么检测当前电脑上是否安装了vc++ 2017的运行时?

问题
-
我的程序依赖Microsoft Visual C++ Redistributable for Visual Studio 2017环境,我现在的做法是,安装时检测注册表
SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{80586c77-db42-44bb-bfc8-7aebbb220c00}
的Installed 找不到,就自动安装下好的离线包;
但是这个guid是特定版本,一旦版本号不一样,就同样检测不到会安装我自带的vc++ 2017。
1、假如我当前开发机上安装的vc++ redistributable版本号是14.14.26429.4,那么客户终端上要运行我的程序vc++ redistributable的版本只要大于14.14.26429.4就行么,还是只要大版本号一样就行?
2、有什么办法更好的在安装时检测当前的vc++环境?
- 已编辑 李冲-LC 2018年7月16日 1:49 不完整
全部回复
-
这个回答应该是目前相对完善的,分享给您作参考
https://stackoverflow.com/questions/12206314/detect-if-visual-c-redistributable-for-visual-studio-2012-is-installed
Visual C++ 2005
Microsoft Visual C++ 2005 Redistributable (x64) Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\1af2a8da7e60d0b429d7e6453b3d0182 Configuration: x64 Version: 6.0.2900.2180
Direct Download URL: https://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x64.EXE
Microsoft Visual C++ 2005 Redistributable (x86) Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\c1c4f01781cc94c4c8fb1542c0981a2a Configuration: x86 Version: 6.0.2900.2180
Direct Download URL: https://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE
Visual C++ 2008
Microsoft Visual C++ 2008 Redistributable (x64) Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\67D6ECF5CD5FBA732B8B22BAC8DE1B4D Configuration: x64 Version: 9.0.30729.5677
Direct Download URL: https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe
Microsoft Visual C++ 2008 Redistributable (x86) Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\6E815EB96CCE9A53884E7857C57002F0 Configuration: x86 Version: 9.0.30729.5677
Direct Download URL: https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe
Visual C++ 2010
Microsoft Visual C++ 2010 Redistributable (x64) Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\1926E8D15D0BCE53481466615F760A7F Configuration: x64 Version: 10.0.40219.325
Direct Download URL: https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe
Microsoft Visual C++ 2010 Redistributable (x86) Registry Key: HKLM\SOFTWARE\Classes\Installer\Products\1D5E3C0FEDA1E123187686FED06E995A Configuration: x86 Version: 10.0.40219.325
Direct Download URL: https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe
专注于.NET ERP/CRM开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms
-
Visual C++ 2012
Microsoft Visual C++ 2012 Redistributable (x64) Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6} Configuration: x64 Version: 11.0.61030.0
Direct Download URL: https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe
Microsoft Visual C++ 2012 Redistributable (x86) Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{33d1fd90-4274-48a1-9bc1-97e33d9c2d6f} Configuration: x86 Version: 11.0.61030.0
Direct Download URL: https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe
Visual C++ 2013
Microsoft Visual C++ 2013 Redistributable (x64) Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{050d4fc8-5d48-4b8f-8972-47c82c46020f} Configuration: x64 Version: 12.0.30501.0
Direct Download URL: https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe
Microsoft Visual C++ 2013 Redistributable (x86) Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{f65db027-aff3-4070-886a-0d87064aabb1} Configuration: x86 Version: 12.0.30501.0
Direct Download URL: https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe
专注于.NET ERP/CRM开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms
-
Visual C++ 2015
Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.24215 Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{d992c12e-cab2-426f-bde3-fb8c53950b0d} Configuration: x64 Version: 14.0.24215.1
Direct Download URL: https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe
Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24215 Registry Key: HKLM\SOFTWARE\Classes\Installer\Dependencies\{e2803110-78b3-4664-a479-3611a381656a} Configuration: x86 Version: 14.0.24215.1
Direct Download URL: https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x86.exe
Visual C++ 2017
Caveat: There's either a new 2017 registry convention being used, or it hasn't been finalized, yet. As I'm guessing the upper-most keys of:
[HKEY_CLASSES_ROOT\Installer\Dependencies\,,amd64,14.0,bundle]
and[HKEY_CLASSES_ROOT\Installer\Dependencies\,,x86,14.0,bundle]
are subject to change, or at least have different nested GUIDs, I'm going to use list the key that ends with a GUID.
Microsoft Visual C++ 2017 Redistributable (x64) - 14.14.26405 Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\,,amd64,14.0,bundle\Dependents\{5b295ba9-ef89-4aeb-8acc-b61adb0b9b5f}] Configuration: x64 Version: 14.14.26405.0
Direct Download URL: https://download.visualstudio.microsoft.com/download/pr/12192820/2cd2dba5748dc95950a5c42c2d2d78e4/VC_redist.x64.exe
Microsoft Visual C++ 2017 Redistributable (x86) - 14.14.26405 Registry Key: [HKEY_CLASSES_ROOT\Installer\Dependencies\,,x86,14.0,bundle\Dependents\{ec9c2282-a836-48a6-9e41-c2f0bf8d678b}] Configuration: x86 Version: 14.14.26405.0
Direct Download URL: https://download.visualstudio.microsoft.com/download/pr/12192785/88b50ce70017bf10f2d56d60fcba6ab1/VC_redist.x86.exe
专注于.NET ERP/CRM开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms