Determining Framework Version

  • Thread starter Thread starter John Bowman
  • Start date Start date
J

John Bowman

Hi All,

I need to determine the version(s) of the dotnet framework that is(are)
currently installed on the target PC. Here's the caveat.... I won't be able
to use dot net code to do this. It'll have to be under C/C++. What's the
best/most preferred technique for determining this? Should I locate the
C:\WINDOWS\Microsoft.NET\Framework folder and then enum through the version
numbered folders and check the version of mscorlib.dll? Or is there a more
straightforward approach such as some registry setting that can be easily
read?

TIA,
 
You are on the right track. If you can hit the Windows alias %WINDIR% rather
than C:\Windows, that would be better, as it will work on machines that are
installed in some config other than the standard.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Gregory,

Thanks. If that was the recommended approach, then I was planning on using
the real windows dir instead of C:\Windows to locate it. I was just hoping
there was a more direct/simpler mechanism that could have been used (: .

John
 
John,
I need to determine the version(s) of the dotnet framework that is(are)
currently installed on the target PC. Here's the caveat.... I won't be able
to use dot net code to do this. It'll have to be under C/C++. What's the
best/most preferred technique for determining this? Should I locate the
C:\WINDOWS\Microsoft.NET\Framework folder and then enum through the version
numbered folders and check the version of mscorlib.dll? Or is there a more
straightforward approach such as some registry setting that can be easily
read?

See if this helps

http://blogs.msdn.com/junfeng/archive/2005/07/07/436755.aspx



Mattias
 
Back
Top