不使用 VCRedist_x86.exe 的 Visual C++ Redistributables [英] Visual C++ Redistributables without using VCRedist_x86.exe

查看:16
本文介绍了不使用 VCRedist_x86.exe 的 Visual C++ Redistributables的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个受到严格限制的环境中进行开发,但开发人员也有严格的控制权.

I'm developing in an environment that is severely constrained, but the developers also have tight control over.

VCRedist_x86.exe - 一个 4Mb 的可再发行文件 - 并不好玩(传输四个小时).我真的更喜欢只重新分发 MFC90.dll、msvcm90.dll、msvcp90.dll 和 msvcr90.dll - 这更像是 2Mb.但是,重新分发 Visual C++ 文件 说:

VCRedist_x86.exe - A 4Mb redistributable - is no fun (four hours to transfer). I'd really prefer to just redistribute MFC90.dll, msvcm90.dll, msvcp90.dll and msvcr90.dll - that's more like 2Mb. However, Redistributing Visual C++ Files says:

不支持重新分发在没有清单的情况下构建的 C/C++ 应用程序.如果没有将应用程序绑定到这些库的清单,C/C++ 应用程序就不能使用 Visual C++ 库.有关详细信息,请参阅选择部署方法.

It is not supported to redistribute C/C++ applications that are built without a manifest. Visual C++ libraries cannot be used by C/C++ applications without a manifest binding the application to these libraries. For more information, see Choosing a Deployment Method.

我将 DLL 复制到程序工作目录的原始计划似乎没有在这个勇敢的清单新世界中工作.

My original plan of copying the DLLs into the program's working directory doesn't seem to work in this brave new world of manifests.

我的下一个猜测是添加将文件填充到 WinSxS 目录所需的注册表项并自己填充(而不是使用 4 meg 程序).

My next guess is to bodge up the registry entries required to populate the files into the WinSxS directory and populate it myself (rather than using the 4 meg program).

该软件经常更新,因此 DLL 比静态链接更受欢迎.[/编辑]

[edit] The software is frequently updated, so DLLs are strongly preferred to static linking. [/edit]

我怎样才能成功地分发必要的文件,同时降低开销?

推荐答案

我们使用这个:如何:在不安装 vcredist_x86.exe 的情况下部署 VC2008 应用

本质上

  • 不要在您的 exe 文件中嵌入清单.
  • 将 C++ DLL 及其清单复制到您的应用目录.
  • 从所有清单(您的和 Microsoft 的)中删除publicKeyToken".
  • 如有必要,更改应用清单文件中的版本信息以匹配 Microsoft 清单文件(反之亦然)

这篇关于不使用 VCRedist_x86.exe 的 Visual C++ Redistributables的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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