我可以将Visual Studio 2015 C ++可再发行的DLL与我的应用程序捆绑在一起吗? [英] Can I bundle the Visual Studio 2015 C++ Redistributable DLL's with my application?

查看:108
本文介绍了我可以将Visual Studio 2015 C ++可再发行的DLL与我的应用程序捆绑在一起吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Microsoft Visual Studio 2015社区版构建了一个C ++应用程序.我正在使用高级安装程序来确保可重新分发给Visual Studio 2015的Visual C ++ 是先决条件.

I've built a C++ application using Microsoft Visual Studio 2015 Community Edition. I'm using Advanced Installer to make sure that the Visual C++ Redistributable for Visual Studio 2015 is a prerequisite.

但是,可再发行的安装程序并不完美.我的一些用户报告说,可重新分发的安装程序挂起,或者安装时提示安装失败,然后用户收到由于您的计算机缺少MSVCP140.dll,此程序无法启动"错误.

However, the redistributable's installer isn't perfect. Some of my users have reported that the redistributable installer hangs, or it fails to install when it says it does, and then users get the "This program can't start because MSVCP140.dll is missing from your computer" error.

根据Microsoft,我现在可以将可再发行的DLL与我的应用程序打包在一起,尽管它们没有推荐它:

According to Microsoft, I can now package the redistributable DLLs along with my application, though they don't recommend it:

要部署可重新分发的Visual C ++文件,可以使用Visual Studio中包含的Visual C ++可重新分发程序包(VCRedist_x86.exe,VCRedist_x64.exe或VCRedist_arm.exe). ...也可以在应用程序本地文件夹(包含可执行应用程序文件的文件夹)中直接安装可再发行的Visual C ++ DLL.出于维修原因,我们不建议您使用此安装位置.

To deploy redistributable Visual C++ files, you can use the Visual C++ Redistributable Packages (VCRedist_x86.exe, VCRedist_x64.exe, or VCRedist_arm.exe) that are included in Visual Studio. ... It's also possible to directly install redistributable Visual C++ DLLs in the application local folder, which is the folder that contains your executable application file. For servicing reasons, we do not recommend that you use this installation location.

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT中有4个文件.这是否意味着我只需要在安装过程中将它们复制到应用程序的目录中即可?

There are 4 files in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT. Does that mean I just need to copy them to my application's directory during the install process?

  • MyApp.exe
  • concrt140.dll
  • msvcp140.dll
  • vccorlib140.dll
  • vcruntime140.dll

可以这样做吗?我需要出示许可证吗?为什么没有更多的人这样做,而不是需要再安装可再发行组件?

Is this OK to do? Do I need to show a license? Why aren't more people doing this instead of requiring yet another preinstall of the redistributable?

推荐答案

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT中有4个文件.这是否意味着我只需要在安装过程中将它们复制到应用程序的目录中即可?

There are 4 files in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT. Does that mean I just need to copy them to my application's directory during the install process?

是的,您引用的段落就是这个意思.

Yes, and the paragraph you quoted means just that.

可以这样做吗?我需要出示许可证吗?为什么没有更多的人这样做,而不是需要再安装可再发行组件?

Is this OK to do? Do I need to show a license? Why aren't more people doing this instead of requiring yet another preinstall of the redistributable?

从技术上讲,这是可以的.如果您想对此进行修养,可以在readmehelp/about中包含一条注释,以表示VC++ 2015 redistributables provided in "local deployment" mode被Microsoft

Technically, that's OK to do. If you want to be pedantic about it, you may include a note in the readme or help/about to the effect that VC++ 2015 redistributables provided in "local deployment" mode as explicitly allowed by Microsoft's Deployment in Visual C++.

关于为什么更多的人不这样做,我想(在所有关心的人中):

As to why more people don't do it, I'd guess that (among those who care at all):

  • 对于像MyApp.exe这样的单模块应用程序,使用静态链接的所有内容进行构建会更容易,以消除开始时的外部依赖性;
  • 包括这些文件可节省分布(大概是下载)大小的1+ MB;
  • 使用运行时的专用副本("local deployment")运行会将更新的责任转移给维护者,因此,在关键/安全性修复的情况下,必须及时重新发行软件包-与"central deployment"相比,它可能会通过Windows Update交付,可能带来好的劣势.
  • for a single module app like MyApp.exe it's easier to build it with everything linked statically as to eliminate external dependencies to begin with;
  • not including those files saves 1+ MB from the distribution (presumably download) size;
  • running with private copies of the runtime ("local deployment") shifts the responsibility of updates to the maintainer, so that in case of a critical/security fix the package would have to be reissued timely - as opposed to "central deployment" where it would likely be delivered via Windows Update, with both the good and bad that may bring.

这篇关于我可以将Visual Studio 2015 C ++可再发行的DLL与我的应用程序捆绑在一起吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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