19

Up to Visual Studio 2013 all you needed was msvcr[version].dll and msvcp[version].dll. Now they changed the DLLs with 2015. What do I need to include in order to avoid a redist installer?

EDIT:

It seems to be impossible now: 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."

UPDATE:

The content of the link above was updated on 11 Sep 2015. Now it's possible to make app-local deployment.

Nikita
  • 6,270
  • 2
  • 24
  • 37
yoni0505
  • 349
  • 2
  • 4
  • 8
  • 2
    Looks like [they've changed their minds](http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx?PageIndex=2#comments) after pretty much everybody complained about this (look for the comment from STL - it's highlighted). However, I haven't been able to find any official documentation about this so far. The MSDN articles haven't been updated yet. The `redist` directory doesn't include `ucrtbase.dll`, which is in `system32` instead (as they said initially). – bogdan Aug 06 '15 at 14:48
  • 3
    Alright, you need to look here: http://blogs.msdn.com/b/vcblog/archive/2015/07/20/visual-studio-2015-rtm-now-available.aspx. Look for the first comment from James McNellis. I was able to deploy a simple app compiled for x86 on Win7 64-bit to a Win8.1 32-bit system that never had the 2015 redistributable installed. I can write a complete answer if you still need it. – bogdan Aug 06 '15 at 16:48

4 Answers4

16

This worked for me (x86 app).

Shipping all dlls from these locations with your app:

  • 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
Robert Muehsig
  • 5,206
  • 2
  • 29
  • 33
3

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).
  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).

If you're using Qt, copy these files into the directory made by windeployqt.

In general, I found that you can just do step #1, and attempt to run your app. 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, e.g., was not successful. I have found using Dependency Walker and trying to satisfy the dependencies it indicates to be unsuccessful.

This allows you to make a portable app that will run on M$ OS's as old as XP; or install for users without vcredist_x86 or vcredist_x64, who don't have admin privileges.

BTW: Step #1 is pretty official. 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.

CodeLurker
  • 1,248
  • 13
  • 22
1

In general, you can use dependency walker to find the list of dependent dlls. Regarding the visual studio runtime dlls, what you are mostly concerned about are the dlls with Visual studio specific versions in them.

Paani
  • 560
  • 3
  • 11
  • Dependency walker for some reason doesn't show ucrtbase.dll as a dependency. You should always include it in your app-local distribution regardless of whether you see it in dependencies or not. – izogfif Aug 20 '15 at 17:27
0

As mentioned at point 6) of this article now it's possible to make local deployment of the Universal 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.

Nikita
  • 6,270
  • 2
  • 24
  • 37