简体   繁体   English

用于应用程序本地部署的 Visual C++ 2015 可再发行 DLL

[英]Visual C++ 2015 redistributable DLLs for app-local deployment

Up to Visual Studio 2013 all you needed was msvcr[version].dll and msvcp[version].dll.在 Visual Studio 2013 之前,您只需要 msvcr[version].dll 和 msvcp[version].dll。 Now they changed the DLLs with 2015. What do I need to include in order to avoid a redist installer?现在他们在 2015 年更改了 DLL。为了避免 redist 安装程序,我需要包含什么?

EDIT:编辑:

It seems to be impossible now: http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx现在似乎不可能了: http : //blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx

"App-local deployment of the Universal CRT is not supported." “不支持通用 CRT 的应用程序本地部署。”

UPDATE:更新:

The content of the link above was updated on 11 Sep 2015. Now it's possible to make app-local deployment.以上链接的内容已于 2015 年 9 月 11 日更新。现在可以进行应用程序本地部署。

This worked for me (x86 app).这对我有用(x86 应用程序)。

Shipping all dlls from these locations with your app:使用您的应用程序从这些位置发送所有 dll:

  • C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86 C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86
  • C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\redist\\x86\\Microsoft.VC140.CRT C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\redist\\x86\\Microsoft.VC140.CRT

Myself, I needed an additional file to make this happen.我自己,我需要一个额外的文件来实现这一点。 Here are the directories, with one in a more generic format:以下是目录,其中一个采用更通用的格式:

  1. Copy all the files from "C:\\Program Files\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86" or "C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86" (or copy them from the x64 directory if it's a 64-bit app).复制“C:\\Program Files\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86”或“C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86”中的所有文件(如果是 64 位应用程序,则从 x64 目录复制它们)。
  2. Copy msvcp140.dll and vcruntime140.dll from: <Visual Studio 2015 Install Directory>\\Microsoft Visual Studio 14.0\\VC\\redist\\x86\\Microsoft.VC140.CRT (or copy them from the x64 directory if it's a 64-bit app).从以下位置复制 msvcp140.dll 和 vcruntime140.dll:<Visual Studio 2015 安装目录>\\Microsoft Visual Studio 14.0\\VC\\redist\\x86\\Microsoft.VC140.CRT(如果是 64 位应用程序,则从 x64 目录复制它们) .

If you're using Qt, copy these files into the directory made by windeployqt.如果您使用 Qt,请将这些文件复制到 Windeployqt 制作的目录中。

In general, I found that you can just do step #1, and attempt to run your app.总的来说,我发现您只需执行第 1 步,然后尝试运行您的应用即可。 It will tell you the first of the files it is missing, and once you have put it in your app's directory, it will tell you the next one you need.它会告诉你它丢失的第一个文件,一旦你把它放在你的应用程序目录中,它就会告诉你下一个你需要的文件。 In my case, it was two.就我而言,它是两个。 Copying similar files from my <Windows>\\System32 folder, eg, was not successful.例如,从我的 <Windows>\\System32 文件夹复制类似的文件没有成功。 I have found using Dependency Walker and trying to satisfy the dependencies it indicates to be unsuccessful.我发现使用 Dependency Walker 并尝试满足它表明不成功的依赖项。

This allows you to make a portable app that will run on M$ OS's as old as XP;这允许您制作一个可在与 XP 一样古老的 M$ 操作系统上运行的便携式应用程序; or install for users without vcredist_x86 or vcredist_x64, who don't have admin privileges.或者为没有 vcredist_x86 或 vcredist_x64 的用户安装,他们没有管理员权限。

BTW: Step #1 is pretty official.顺便说一句:第 1 步非常正式。 Here it is at the MSDN blog: Introducing the Universal CRT They say to copy them all for an app to run on all M$ OS's.这是在 MSDN 博客上: 介绍通用 CRT他们说要复制它们,以便应用程序在所有 M$ 操作系统上运行。

In general, you can use dependency walker to find the list of dependent dlls.一般情况下,您可以使用dependency walker 来查找依赖dll 的列表。 Regarding the visual studio runtime dlls, what you are mostly concerned about are the dlls with Visual studio specific versions in them.关于 Visual Studio 运行时 dll,您最关心的是其中包含 Visual Studio 特定版本的 dll。

As mentioned at point 6) of this article now it's possible to make local deployment of the Universal CRT.截至6点)提到的这个文章,现在有可能使通用CRT的本地部署。 To do that you should install Windows 10 SDK and copy all the binaries from C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\u003c/code> .为此,您应该安装Windows 10 SDK并从C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\u003c/code>复制所有二进制C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\u003c/code> 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用于应用程序本地部署的MSVC 2015 Universal CRT - MSVC 2015 Universal CRT for app-local deployment 将Visual Studio 2015的Visual C ++ Redistributable添加到InstallShield - Add Visual C++ Redistributable for Visual Studio 2015 to InstallShield Visual Studio 2015 的 C# 和 C++ Redistributable 缺少依赖项 - Missing dependencies with C# and C++ Redistributable for Visual Studio 2015 安装 Visual Studio 2015 时出错,关于“Microsoft Visual C++ 2015 Redistributable” - Errors in installing Visual Studio 2015, regarding "Microsoft Visual C++ 2015 Redistributable" visual c ++ 2010可再发行 - visual c++ 2010 redistributable Visual c + +可再分发的再分发 - Visual c++ redistributable redistribution 无法安装Visual Studio 2015(64位)的Visual C ++可再发行组件 - Cannot install Visual C++ Redistributable for Visual Studio 2015 (64-bit) 如何自动安装用于Java代码的Visual Studio 2015的Visual C ++可再发行组件 - how to automatically install Visual C++ Redistributable for Visual Studio 2015 used in a java code Visual C ++ 2017 Redistributable包可以支持使用VC2015的应用程序吗? - Can Visual C++ 2017 Redistributable package support the applications that use VC2015? 我可以将 Visual Studio 2015 C++ Redistributable DLL 与我的应用程序捆绑在一起吗? - Can I bundle the Visual Studio 2015 C++ Redistributable DLL's with my application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM