Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how .NET  Framework is installed.

Posted on 2006-11-03
5
Medium Priority
?
374 Views
Last Modified: 2010-04-24
Hi

How can i check that .NET  Framework is installed before launching my .NET  Framework application from c++ code?

Regards
0
Comment
Question by:quali
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17865355
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 17865816
You can test whether mscoree.dll exists in the %SystemRoot%\system32 directory.
To determine which .NET Framework versions are installed, enunerate keys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy
0
 

Author Comment

by:quali
ID: 17879649
>>You can test whether mscoree.dll exists in the %SystemRoot%\system32 directory.
how can i test it in c++ programme?
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 750 total points
ID: 17879796
BOOL FileExists(LPCTSTR sFileName)
{
    TCHAR name[1000];

    ExpandEnvironmentStrings(sFileName, name, 1000);

    DWORD dwResult = GetFileAttributes(name);

    if ( dwResult == 0xffffffff  ||
        dwResult & FILE_ATTRIBUTE_DIRECTORY )
    {
        return FALSE;
    }

    return TRUE;
}

if ( FileExists(_T("%SystemRoot%\\system32\\mscoree.dll")))
{
    // exists
}
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question