分发Visual C ++运行时库(MSVCRT) [英] Distributing the Visual C++ Runtime Libraries (MSVCRT)

查看:209
本文介绍了分发Visual C ++运行时库(MSVCRT)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Visual Studio 2008开发的ATL / WTL项目,直到现在我已经静态链接到CRT库,避免了发送它们。但是,现在我需要考虑使用动态库(DLL),以减少代码的大小,因为我想使用优秀的 crashrpt 工具(需要动态链接到CRT。)



现在,MS提供了一个独立安装程序(vcredist_x86.exe)和MSM软件包,但这对我来说没有好处,有两个原因:




  • 我没有使用基于MSI安装程序(我使用InnoSetup)。

  • 我的应用程序安装在有限的用户帐户上,vcredist_x86.exe安装程序将无法正常工作。



因此,我想运送CRT DLL,然后在我的应用程序文件夹中安装。现在,这是您可以做的,因为我发现以下MSVC图书馆开发主管Martyn Lovell的博客文章


但是,如果你想要
install-applocal,你应该确保
你的应用程序有一个清单
,然后将整个文件夹
复制到你的EXE目录:



X:\Program Files \Microsoft Visual
Studio
8 \VC\redist\x86\Microsoft.VC80.CRT



和其他文件夹,如果你使用超过
的CRT。确保你包括
清单。


只是想我后 - 除了我不明白这部分: / p>


请确保您的应用程式有清单


我的问题是 - 如何创建一个应用程序清单,引用我想使用的CRT DLL?我的项目目前使用的唯一的清单信息是以下(它确保应用程序使用共同控件的v6):

  / manifestdependency :\type ='win32'name ='Microsoft.Windows.Common-Controls'version ='6.0.0.0'processorArchitecture ='x86'publicKeyToken ='6595b64144ccf1df'language ='*'\

有人可以使用Visual Studio 2008为我提供如何使用清单魔术的说明吗?在我的Visual Studio VC \redist\x86 \Microsoft.VC90.CRT文件夹中有一个Microsoft.VC90.CRT.manifest文件夹 - 我需要使用这种方式吗?



注意:这与有类似但却不同的问题这一个

解决方案

当您传递/ MD标志时,Visual Studio将为您生成正确的清单。 / p>

I have an ATL/WTL project developed using Visual Studio 2008 and up until now I have been statically linking with the CRT libraries, avoiding the need to ship them. However, I now need to consider using the dynamic libraries (DLL) instead - in order to reduce the size of the code and because I want to use the excellent crashrpt tool (which requires you dynamically link to the CRT.)

Now, MS supply both a stand-alone installer (vcredist_x86.exe) and an MSM package but this is no good for me for two reasons:

  • I am not using an MSI based installer (I am using InnoSetup).
  • My application installs on a limited user account and the vcredist_x86.exe installer will not work.

Therefore I want to ship the CRT DLLs and install then in my applications program folder. Now, this is something you can do as I found the following blog post by Martyn Lovell, the MSVC Libraries Development Lead that says:

However, if you want to install-applocal, you should make sure that your application has a manifest, and then copy the whole of this folder into your EXE directory:

X:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT

and other folders if you use more than the CRT. Make sure you include the manifest.

Just want I am after - except I don't understand this part:

make sure that your application has a manifest

My question is - how do I create an application manifest that references the CRT DLLs I want to use? The only manifest information my projects currently use is the following (which ensures the app uses v6 of the Common Controls):

/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"

Can someone provide me with instructions on how to work the manifest magic using Visual Studio 2008? There is a Microsoft.VC90.CRT.manifest file in my Visual Studio VC\redist\x86\Microsoft.VC90.CRT folder - do I need to use this somehow?

Note: This is a similar - but different - question to this one.

解决方案

Visual Studio will generate the correct manifest for you when you pass the /MD flag.

这篇关于分发Visual C ++运行时库(MSVCRT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆