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

前端 未结 10 1106
萌比男神i
萌比男神i 2020-12-16 09:16

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 - Profes

10条回答
  •  -上瘾入骨i
    2020-12-16 09:51

    For anyone stumbling on this question, here is the answer if you are doing C++: You can check in your cpp code for vs version like the example bellow which links against a library based on vs version being 2015 or higher:

    #if (_MSC_VER > 1800)
    #pragma comment (lib, "legacy_stdio_definitions.lib")
    #endif
    

    This is done at link time and no extra run-time cost.

提交回复
热议问题