Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redistributables for deploying C++ exe developed with Visual Studio 2015 on Windows 7

I have developed a 32-bit C++ application using Visual Studio 2015 (on Windows 10). I want to deploy it onto machines running Windows 7 and later.

I put together a WiX installer and included the VC++ redistributable merge module as described here. The merge module I included was C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC140_CRT_x86.msm.

This installer appears to work fine but on Windows 7 the installed program will not run, complaining about missing api-ms-win-crt-runtime-l1-1-0.dll.

From searching I suspect that there may be extra files in the redistributable package vc_redist.x86.exe from here, but the WiX docs tell me to use an msm rather than an exe.

It's also possible that the merge module failed to install. I didn't see any errors but I haven't re-run it with logs enabled to check that possibility.

Another option may be to use burn but I am not familiar with this tool; I will go that route if it's the correct one but I'd prefer to stick with MSI if possible.

like image 763
Peter Hull Avatar asked Jan 04 '16 13:01

Peter Hull


People also ask

Where can I download the C++ redistributable for Visual Studio 2019?

The redistributable is available in the my.visualstudio.com Downloads section as Visual C++ Redistributable for Visual Studio 2019 - Version 16.7. Use the Search box to find this version. To download the files, select the platform and language you need, and then choose the Download button.

Which version of Visual Studio 2015 requires C++ runtime 2015?

Microsoft Visual C++ 2015 Redistributable Applications created with Visual Studio 2015 (Version 14.0) require C++ runtime 2015. If you have an application that is giving an error about MSVCR140.dll or MSVCP140.dll missing, you should install this version of Visual C++ 2015 redistributable.

How to install Visual C++ redistributable runtimes all-in-one?

Visual C++ Redistributable Runtimes All-in-One comes as a zip file with all versions of VC++ included and a simple batch file. Download it from the link below, unzip to a folder and run install_all.bat. This will install all the redistributables from version 2005 to 2019. All the installs are silent and do not require user intervention.

How do I deploy redistributable files in Visual Studio?

To deploy redistributable files, you can use the redistributable packages installed by Visual Studio. In versions of Visual Studio since 2017, these files are named vc_redist.arm64.exe, vc_redist.x64.exe, and vc_redist.x86.exe.


2 Answers

The VC++ runtime redistributables got more complicated in Visual Studio 2015. See the VC team blog post about the universal CRT. Basically, the merge module is insufficient:

There will not be a merge module for the Universal CRT. If you currently use the CRT merge modules and still want to deploy the Visual C++ libraries centrally, we recommend that you move to the above mentioned Windows Update package or to the VCRedist. Alternatively, you may choose to link statically to the Universal CRT and the Visual C++ libraries.

like image 93
Bob Arnson Avatar answered Nov 16 '22 01:11

Bob Arnson


We ran into the trouble that the MSI package failed to install the redistributable with MSI Error 1618: 'Another installation is already in progress' during installation/uninstallation. We installed the 2015 redistributable with WIX by using a Bootstraper. For example:

<Chain>
  <!-- Microsoft Visual C++ 2015 x86 libraries -->
  <ExePackage Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
     SourceFile="EXAMPLE_PATH\vc_redist.x86.exe" InstallCommand="/install /passive /norestart">
  </ExePackage>

  <MsiPackage Id="MainPackage" SourceFile="YOUR_MSI_PACKAGE.msi" DisplayInternalUI="no" Compressed="yes" Vital="yes"/>
</Chain>

like image 22
ChristianMurschall Avatar answered Nov 16 '22 01:11

ChristianMurschall