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

前端 未结 10 1058
萌比男神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条回答
  •  醉梦人生
    2020-12-16 10:03

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

    eg I've got:

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

    and

    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.

提交回复
热议问题