正确的方式来分发VC ++运行时文件 [英] Correct way to distribute VC++ runtime files
问题描述
我不能使用合并模块,因为我的安装程序不支持它们。
我知道我可以运行VCRedist_x86.exe,但是我不想因为各种原因而这样做。
只要我看到我唯一的选择是将文件安装为私有并排程序集。这是否正确?
根据 http://msdn.microsoft.com/en-us/library/ms235317(VS.80).aspx 安装专用程序集的正确方法是复制Microsoft。 VC90.CRT'和'Microsoft.VC90.MFC'文件夹与可执行文件相同。这是解决问题的正确方法吗?它的工作原理,但似乎有一个90年代以这种方式复制系统文件。任何人都可以向我展示另一个应用程序(或至少一个演示项目)的例子吗?
最后,我什么时候需要担心分发.manifest文件为我的申请?我应该明确安装XML文件,还是将其嵌入到我的可执行文件中?
通常我会说你应该在目标机器上安装所需的可重新分发,因为它是干净的方式。但你也可以做到90年代风格。它强烈地依赖于您正在使用哪个CRT / MFC lib来构建应用程序。这可以在清单文件中检查。您也可以强制应用程序与指定的lib绑定。没有任何定义VS2008通常绑定9.0.21022.8,与
#define _BIND_TO_CURRENT_VCLIBS_VERSION 1
最近的lib被采用。您还可以绑定指定的版本:
#define _CRT_ASSEMBLY_VERSION9.0.30729.1
和/或
#define _MFC_ASSEMBLY_VERSION 9.0.30729.1
所以如果你想这样做90年代的风格, code> C:\Windows\Winsxs\ 并从您绑定的文件夹中获取DLL,例如从 amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_99b61f5e8371c1d4
如果您使用CRT为x64应用程序或等效的 x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_99b61f5e8371c1d
为x86版本的CRT。
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?
Normally I would say that you should install the required redistributable on the target machine as it is the "clean way". But you can also do it the 90s style. It strongly depends which CRT/MFC lib you are using to build the application. This can be inspected within the manifest file. You can also force the application to bind with a specified lib. Without any define VS2008 normally binds the 9.0.21022.8, with
#define _BIND_TO_CURRENT_VCLIBS_VERSION 1
the most recent libs are taken. You can also bind with a 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 it the 90s style, copy the files from C:\Windows\Winsxs\
and take the DLLs from that folder you binded with, e.g. from amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_99b61f5e8371c1d4
if you use CRT for an x64 application or the equivalent x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_99b61f5e8371c1d
for the x86 version of CRT.
这篇关于正确的方式来分发VC ++运行时文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!