how .NET  Framework is installed.

Posted on 2006-11-03
Last Modified: 2010-04-24

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

Question by:quali
  • 2
LVL 12

Expert Comment

ID: 17865355
LVL 48

Expert Comment

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

Author Comment

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

Accepted Solution

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

    ExpandEnvironmentStrings(sFileName, name, 1000);

    DWORD dwResult = GetFileAttributes(name);

    if ( dwResult == 0xffffffff  ||
        return FALSE;

    return TRUE;

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Cchar * Concating 7 96
how to change my public IP to any country.... 9 85
Visual Studio 2015 error "not a valid Win32 application" 6 617
Visual Studio 2013 and Eclipse Neon 6 52
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++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 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