C++ – Correct way to distribute VC++ runtime files

assembliesccrtdeploymentruntime

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

I can't use merge modules as my installer doesn't support them.
I know I can run VCRedist_x86.exe, but I don't want to do this for various reasons.

As far as I can see my only alternative is to install the files as Private Side-by-Side assemblies. Is this 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 the 'Microsoft.VC90.CRT' and 'Microsoft.VC90.MFC' folders to the same folder as the executable. Is this the correct way to solve the problem? It works, but it seems a bit 1990s to copy system files in this manner. Can anyone 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 a .manifest file for my application? Am I supposed to explicitly install the XML file, or is it embedded in my executable somehow?

Best Answer

You could also consider statically linking with both MFC and the CRT, then you only need to ship your EXE files. There are pros and cons to this though.

Related Topic