Перейти к содержимому

Visual c как узнать какой установлен

  • автор:

How can I check what version/edition of Visual Studio is installed programmatically?

I could read registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0 . However, it doesn’t give me any information about the edition of it — Professional/Ultimate or whatever.

How can I get the information with programmatically (preferably python)?

enter image description here

10 Answers 10

In Visual Studio, the Tab ‘Help’-> ‘About Microsoft Visual Studio’ should give you the desired infos.

You can get the VS product version by running the following command.

nmctwisp's user avatar

Open the installed visual studio software and click the Help menu select the About Microsoft Visual studio—> Get the visual studio Version

Irvin Dominin's user avatar

if somebody needs C# example then:

Run the path in cmd C:\Program Files (x86)\Microsoft Visual Studio\Installer>vswhere.exe

Its not very subtle, but there is a folder in the install location that carries the installed version name.

C:\Program Files\Microsoft Visual Studio 9.0\Microsoft Visual Studio 2008 Standard Edition — ENU

C:\Program Files\Microsoft Visual Studio 10.0\Microsoft Visual Studio 2010 Professional — ENU

You could find the install location from the registry keys you listed above.

Alternatively this will be in the registry at a number of places, eg:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\Microsoft Visual Studio 2008 Standard Edition — ENU

There are loads of values and keys with the string in, you can find them by looking for «Microsoft Visual Studio 2010» in the Regedit>Edit>Find function.

You’d just need to pick the one you want and do a little bit of string matching.

Microsoft Visual — как узнать какая версия?

Проще всего узнать, какой релиз уже встроен в систему, посмотрев список установленных приложений. Для этого:

Используйте сочетание клавиш «Windows» + «R».

В отобразившемся окне напишите appwiz.cpl и кликните «ОК».

В перечне приложений найдите «Microsoft Visual C++…», и посмотрите, версии каких годов уже проинсталлированы.

Обращаем внимание на то, что x64 и x86 – это обозначение архитектуры версии.

Visual c как узнать какой установлен

Posted: 04 Jan 2018 — csharp

Last updated October 16 2019.

This post discusses how to check if the Microsoft Visual C++ Runtime is installed. If you’re just looking for a quick way to do this, you may want to consider using the library MscVersion source code on GitHub and a package on NuGet. MscVersion is a pure C# library alternative to the _MSC_VER macro in C++ which lets you check what version of the VcRuntime is installed.

In C++ if we want to check if a particular version of the runtime is installed we can write conditionals to test the value of the built-in preprocessor macro _MSC_VER against known values indicating major releases of the Visual C++ compiler. See this post from the Visual C++ Team Blog on Visual C++ Compiler Version and the MSDN page on Predefined Macros.

The following table highlights the major versions of Visual C++ against the _MSC_VER value.

Visual Studio Version MSVC++ Version _MSC_VER
Visual Studio 97 version 5.0 MSVC++ 5.0 1100
Visual Studio 6.0 version 6.0 MSVC++ 6.0 1200
Visual Studio .NET 2002 version 7.0 MSVC++ 7.0 1300
Visual Studio .NET 2003 version 7.1 MSVC++ 7.1 1310
Visual Studio 2005 version 8.0 MSVC++ 8.0 1400
Visual Studio 2008 version 9.0 MSVC++ 9.0 1500
Visual Studio 2010 version 10.0 MSVC++ 10.0 1600
Visual Studio 2012 version 11.0 MSVC++ 11.0 1700
Visual Studio 2013 version 12.0 MSVC++ 12.0 1800
Visual Studio 2015 version 14.0 MSVC++ 14.0 1900
Visual Studio 2017 version 15.0 MSVC++ 14.1 1910
Visual Studio 2017 version 15.3 MSVC++ 14.11 1911
Visual Studio 2017 version 15.5 MSVC++ 14.12 1912
Visual Studio 2017 version 15.6 MSVC++ 14.13 1913
Visual Studio 2017 version 15.7 MSVC++ 14.14 1914

In C# its not so easy. Instead we have to look for the Visual C++ runtime as installed products. The Microsoft Windows Installer function MsiQueryProductState() can help with this. It takes a product code guid as the input parameter, and returns the installation state of the program.

We therefore need to know the guid product code of each version to check if its installed. As it turns out, there are a lot of versions. Microsoft don’t seem to publish a full list with associated guids either, so we have to assemble our own.

Assembling the full list was a little time consuming, but as of the time of writing the class below can detect every version of the runtime released to date.

Calling VcRuntime.KnownRuntimeVersions will return the full list of known runtimes and guids, and GetInstalledRuntimeVersions() will do just that. Pass it a collection of VcRuntimeVersion typed objects and it will tell you which of those product versions, if any, are installed.

We can use these two functions to craft expressive queries. In the following example, I want to know if any versions of the vc++ runtime are installed from Visual Studio 2013 onwards which also target 64bit operating systems.

The full VcRuntime class is below:

Appendix

The information used to build the code for this post is reprinted below in tabular format, for reader convenience.

Как узнать какая версия Microsoft Visual C++ установлена на компьютере?

просто у меня ошибка вылезает и говорят, что ее можно попробовать устранить установив Visual C++ 2005, но я припоминаю что у меня вроде уже стоит он и даже более новой версии 2008 вроде.

И мне лень сейчас скачивать этот Visual C++ ,инсталлить его и в итоге скорее всего эти действия мою шибку неисправят

Собственно проблема скорее всего не в пакете библиотек с++, а приложении, которое их использует. Согласитесь, что очень странно, когда язык программирования используется тысячами программ и вдруг в нём нашлась ошибка =)

Не нужна переустановка. Ищите саму программу, вызвавшую ошибку в более новой версии или альтернативу ей.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *