The correct way to distribute VC ++ runtime files

I have an MFC application that I am trying to install for deployment. This seems to depend on the msvcr90.dll ',' msvcp90.dll 'and' mfc90.dll 'files. What is the correct way to distribute these files?

I cannot use merge modules because my installer does not support them. I know that I can run VCRedist_x86.exe, but I do not want to do this for various reasons.

As far as I can see, the only alternative is to install the files as Side-by-Side builds. Is it correct?

According to http://msdn.microsoft.com/en-us/library/ms235317(VS.80).aspx , the correct way to install a private assembly is to copy "Microsoft.VC90.CRT" and "Microsoft". VC90.MFC 'in the same folder as the executable file. Is this the right way to solve the problem? It works, but it seems like a bit of the 1990s copies system files this way. Can someone show me an example of another application (or at least a demo project) that does this?

Finally, when do I need to worry about distributing the .manifest file for my application? Do I have to explicitly install the XML file, or is it somehow embedded in my executable?

+7
c ++ deployment crt runtime assemblies
source share
3 answers

Normally, I would say that you have to install the required redistribution on the target machine, since it is a "clean way". But you can also do it in the style of the 90s. It depends a lot on which CRT / MFC lib you use to build the application. This can be verified in the manifest file. You can also force the application to bind to the specified lib. Without any definition, VS2008 usually associates 9.0.21022.8 with

#define _BIND_TO_CURRENT_VCLIBS_VERSION 1 

the latest libraries are taken. You can also contact the specified version:

 #define _CRT_ASSEMBLY_VERSION "9.0.30729.1" 

and / or

 #define _MFC_ASSEMBLY_VERSION "9.0.30729.1" 

So, if you want to do this in the style of the 90s, copy the files from C:\Windows\Winsxs\ and take the DLLs from the folder with which you are linked, for example. by amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_99b61f5e8371c1d4 , if you are using a CRT for x64 applications or equivalent x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_99b61f5e8371c1d for x86-version of the CRT.

+1
source share

You can also consider the static connection with both MFC and CRT, then you only need to send your EXE files. There are pros and cons to this, though.

+1
source share

I would say that this is enough to put these DLLs together with your exe, because the current path is where they are first looking.

Of course, you should strive to install redistributable as a safer tool.

+1
source share

All Articles