Visual C++ 2015 redistributable DLLs for app-local deployment

前端 未结 4 1995
天命终不由人
天命终不由人 2020-12-25 14:45

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 red

4条回答
  •  独厮守ぢ
    2020-12-25 14:58

    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: \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 \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.

提交回复
热议问题