How to determine whether VS is installed?
Started by hanzibal, Sep 27 2012 08:38 PM
5 replies to this topic
#1
Posted 27 September 2012 - 08:38 PM
Hi all!
I'm currently writing a Windows application where I need to programmatically make sure Visual Studio is installed before performing certain tasks.
Do any of you guys know of robust ways for doing this?
Bonus question: Do you also know how to determine the version of the VS instance installed.
#2
Posted 27 September 2012 - 09:17 PM
You can probably scan the registry keys in the KKEY_CLASSES_ROOT hive and look for the ProgID (in quotes below):
- Visual Studio .NET 2002: "VisualStudio.DTE.7"
- Visual Studio .NET 2003: "VisualStudio.DTE.7.1"
- Visual Studio 2005: "VisualStudio.DTE.8.0"
- Visual Studio 2008: "VisualStudio.DTE.9.0"
- Visual Studio 2010: "VisualStudio.DTE.10.0"
#3
Posted 27 September 2012 - 09:51 PM
As Dave suggested scan the registry
more info here: http://blogs.msdn.co...tudio-2010.aspx although its targeting visual studio 2010 its a virtually identical process for prior versions
Depending on how robust a check you want to do you could also check the file system, although the registry should suffice.
Nak.
#5
Posted 28 September 2012 - 05:20 AM
Wow, four replies within hours. Thanks guys, I'll have a look at it all when I get home from work this evening.
#6
Posted 29 September 2012 - 01:08 AM
Thank you guys, I think I'm pretty much covered now.
vs.PNG 6.3KB 3 downloads
As said, I'm building a Windows app and it will rely on VS for compilation and (foremost) Visual Studio Express since its free which is great. Generally, I think MS is much more on the right track now than they used to be and it won't surprise me a bit if they, eventually, will win the "war" against the fruit company when it comes to handhelds, tablets and all that - but that's only my personal guess
Oh, and btw I found this article on "IP obesity" very interesting:
http://www.sparkfun.com/news/963
Thanks Dave, this is what an excerpt of my registry looks like. Funny thing is that, even though I've got VS 2010 Express installed, it doesn't actuall show or does it?. Explanation to be found among the other answers I think.You can probably scan the registry keys in the KKEY_CLASSES_ROOT hive and look for the ProgID....
vs.PNG 6.3KB 3 downloads
Great, thanks!As Dave suggested scan the registry
more info here: http://blogs.msdn.co...tudio-2010.aspx although its targeting visual studio 2010 its a virtually identical process for prior versions...
Yes, very much so. I think I got what I need to suffice now.Does this help? http://www.mztools.c.../MZ2008003.aspx
As said, I'm building a Windows app and it will rely on VS for compilation and (foremost) Visual Studio Express since its free which is great. Generally, I think MS is much more on the right track now than they used to be and it won't surprise me a bit if they, eventually, will win the "war" against the fruit company when it comes to handhelds, tablets and all that - but that's only my personal guess
Oh, and btw I found this article on "IP obesity" very interesting:
http://www.sparkfun.com/news/963
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users