best way to check the installation of mfc80 side by side

  • Thread starter Thread starter Dieter Pelz
  • Start date Start date
D

Dieter Pelz

Hallo,

what is the best way to check the installation of mfc80 and vcrt sidebyside
assemblies?



Best Regards,
Dieter Pelz
 
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.
 
Hi Dieter,

Have you reviewed my reply? Does it make sense to you? If you still need
any help or have any concern, please feel free to tell me, thanks.

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.
 
Hi Jeffrey,

first it's on the deployment machine,

msvcr80.dll and mfc80.dll are in my interest.

The MFC/CRT library could not be static linked because C++/CLI is also used.

Is checking the existence of the folders enough or should I check the files?

Could I use this for all OS (W2K, XP,W2K3 and Vista.)?

Best Regards,
Dieter Pelz
 
Hi Dieter,

Thanks for your feedback!

I have tried to discuss this issue with VC product team, below is their
comment and suggestion:

If you are building an MSI, you should include the appropriate MSMs into
your MSI. The MSMs are installed by Visual Studio into the "Program
Files\Common Files\Merge Modules" directory. Then the necessary components
would automatically be properly installed if they are missing, and would be
marked as being needed by your product. You would need to add these MSMs to
your MSI:
Microsoft_VC80_CRT_x86.msm
Microsoft_VC80_MFC_x86.msm
policy_8_0_Microsoft_VC80_CRT_x86.msm
policy_8_0_Microsoft_VC80_MFC_x86.msm

If you are not building an MSI, your product should run vcredist_x86.exe to
automatically install the CRT if it is not already installed. It can be
found in Program Files\Microsoft Visual Studio
8\SDK\v2.0\Bootstrapper\Packages.

This is the recommended way of deploying the MFC product.

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.
 
Hi Dieter,

Have you reviewed my last reply to you? Does the suggestion of including
VC8 CRT/MFC MSMs and vcredist_x86.exe during deploying make sense to you?
If you still need any help or have any concern, please feel free to tell
me, thanks.

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.
 
Hi Jeffrey,

thanks for your answer.

The application is running from a network share.
We use already an MSI to install the runtime libraries and to configure CAS.
To check the existance of the runtime and CAS settings I wrote an C# loader
application.
And there I want check the libraries.

Now I'm checking the existance of the directories in the WinSxS, this seem
to be OK.
So again is this enough for all OS (W2K, XP,W2K3 and Vista.)?

Is your suggested vcredist_x86.exe also for VS2005 SP1?

What's the best way to install the debug version of MFC and VCRT for remote
debugging purpose?


Best Regards,
Dieter Pelz
 
Hi Dieter,
Sorry for the late response, since Jeffery asked for two days sick leave. I
will work with you on this post.

Since you are just interested in msvcr80.dll and mfc80.dll, I believe that
checking the existance of the directories (x86_Microsoft.VC80.CRT_xxxxxx
and x86_Microsoft.VC80.MFC_xxxxxx) in the WinSxS folder is enough. Please
note that if the target machine is Windows 2000, the libraries should be
also installed to the System32 directory. You may refer to:
How to: Deploy using XCopy
http://msdn2.microsoft.com/en-us/library/ms235291(VS.80).aspx

For your question, "is your suggested vcredist_x86.exe also for VS2005
SP1?", I am afraid that you need to perform a test to check if there is any
issue affecting your application; however now an update to VCRedist.exe is
available. You can contact PSS to get it. Please refer to:
An update to the Visual C++ Redistributable Package (VCRedist.exe) is
available that adds support for side-by-side deployment of the Visual C++
runtime
http://support.microsoft.com/kb/923610

For your last questions, "What's the best way to install the debug version
of MFC and VCRT for remote
debugging purpose?", I am afraid that it is not possible since debug
versions of the DLLs are not redistributable. If you want to install the
debug version of MFC and VCRT, you need to install Visual Studio 2005.
Please refer to:
Redistributing the MFC Library
http://msdn2.microsoft.com/en-us/library/ms235264(vs.80).aspx

Hope this helps. If you have any other questions or concerns, please feel
free to let me know.

Sincerely yours,
Charles Wang
Microsoft Online Community Support

======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
 
Hi Charles

I've been reading this thread and I'm running into a similar problem,
maybe you can help. We have an app that needs mfc, in win2k we can
copy the dll's into the local app folder that contains the exe and
then run no problem, but trying to do this on winxp generates an
error:

The application has failed to start because the application
configuration is incorrect. Reinstalling the application may fix this
problem.

Now I know that if I run the vc++ redist.exe it will put all the dll's
into WinSxS and it will work, but my problem is that the client runs
all desktops as with User privileges and I can't install the exe, also
I can't statically link the mfc dll's into the app. I tried doing what
it said for an xcopy deployment and that doesn't seem to help. Any
suggestions?

Evan Brown
 
I've been reading this thread and I'm running into a similar problem,
maybe you can help. We have an app that needs mfc, in win2k we can
copy the dll's into the local app folder that contains the exe and
then run no problem, but trying to do this on winxp generates an
error:
The application has failed to start because the application
configuration is incorrect. Reinstalling the application may fix this
problem.

Welcome to manifest hell, the sequel to the ever-so-popular DLL
hell. Best solution I've found so far is to try and turn off the
manifests for the exe. For each exe, dll you build for your app, go
into the linker settings and the manifest item under linker. Turn off
embedding a manifest. Also look one level up (at the same level as
linker) to turn off the manifests.

Frankly, it seems like manifests are v0.8alpha at best, and MS
typically needs to get to v3.0 to get something right. Magic XML
incantations are supposed to do something, but documentation is spotty
at best.

Nathan Mates
 
Hello Evan,

one solution is to copy whole file for mfc80 and there manifest into your
exe path.
This will function as long you don't start your app is running from your
local computer.
When you're using C++/CLI and your app is running from another security zone
you could not use this approach, because there are managed mfc-dlls and you
will get exceptions while loading.


Dieter Pelz
 
Back
Top