Hi Dieter,
Do you want to check the existence of MFC or the assemblies for C++/CLI?
Also, do you want to check them programmatically for the deployment
machine? Since this is the .Net VC newsgroup, I first assume you want to
find out if the deployment machine has got the .Net VC assemblies
installed. If I have misunderstood you, please feel free to tell me,
thanks.
Since C++/CLI will use the same .Net Framework as other .Net languages,
VB.net, VC#, so it will use the same set of .Net assemblies in GAC as other
languages. So if you want to check existence of the assemblies for C++/CLI,
you may only check the existence of .Net2.0 Framework. The official
recommended way of checking .Net2.0 existence is locating the
%systemroot%\Microsoft.NET\Framework folder for "v2.0.50727" folder, please
refer to the KB below:
"How to determine which versions of the .NET Framework are installed and
whether service packs have been applied"
http://support.microsoft.com/kb/318785
You may also find the following article useful:
"The coding gentleman's guide to detecting the .NET Framework"
http://www.codeproject.com/dotnet/DetectDotNet.asp
If you want to check the existence of msvcr80.dll(CRT) and mfc80.dll(MFC)
under C:\WINDOWS\WinSxS directory, I recommend you enumerate all the
folders in "C:\WINDOWS\WinSxS" directory. Any folder with name
"x86_Microsoft.VC80" and "8.0.50727.42" should be the VC8 32-bit SxS
assemblies folder. The "MFC" or "CRT" in the folder name implies that the
folde is for MFC or CRT. Furthermore, the presence of "Debug" means the
"debug" version or not. This logic is not hard to implement in program.
Another solution is static linking your required version of MFC/CRT library
into the Exe, so that your application can be deployed to the end user
machine without checking the existence of these 2 runtime Dlls. The
disadvantage is that this will increase the size of your application Exe.
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.