Determining Framework Version

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,
 
G

Guest

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!
***************************
 
J

John Bowman

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
 
M

Mattias Sjögren

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top