how .NET Framework is installed.

Hi

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

Regards
qualiAsked:
Who is Participating?
 
AlexFMConnect With a Mentor Commented:
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
 
rajeev_devinCommented:
0
 
AlexFMCommented:
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
 
qualiAuthor Commented:
>>You can test whether mscoree.dll exists in the %SystemRoot%\system32 directory.
how can i test it in c++ programme?
0
All Courses

From novice to tech pro — start learning today.