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

3

18

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.

Undulant answered 4/1, 2016 at 13:34 Comment(0)
S
11

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.

Seagirt answered 4/1, 2016 at 18:57 Comment(6)
Just to confirm my own understanding - their preferred method is VCRedist and this means I need to use burn?Undulant
You need to use VCRedist to get the universal CRT installed on Windows 7/8. VCRedist is built with Burn so it works well with other Burn bundles.Seagirt
So, is there no way to actually use a merge module for 2015 VC redist? I would much prefer that way so that I don't have to use a bootstrapper to launch an .exe file. Are there any solutions that can be run natively in wix that don't require a bootstrapper?Jennettejenni
Well that's just great. Another version of Visual Studio and once again stuff that has worked for years is now 'unsupported'.Fortran
Actually, the merge module Microsoft_VC140_CRT_x86.msm contains UCRT, but only for Windows XP (conditional installation). All Windows starting from Vista should get the UCRT via Windows updates, or vc_redist. So if you use msm and test your installer on WXP, it will work, but the UCRT might be missing on a newer OS.Batchelor
IF in a pickle, you can now do app-locale redistribution. There may be cases where this can be defended, while it's preferable not actually carrying all the dll's in the app folder. - install the "SDK for Windows 10 " : dev.windows.com/en-us/downloads/windows-10-sdk and then the required files can be found in C:\Program Files (x86)\Windows Kits\10\Redist\ucrt. You will need to copy all of the DLLs with your app, diffferent DLLs are necessary on different versions of Windows, so you must include all of the DLLs in order for your program to run on all Windows versions..Stearic
S
3

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>

Supersaturated answered 8/11, 2016 at 14:37 Comment(0)
J
2

It's worth noting that it is now possible to distribute the Universal C Runtime DLLs with your application. The MSDN blog post describes the steps:

  1. Install the Windnows 10 SDK
  2. Go to C:\Program Files (x86)\Windows Kits\10\Redist\ucrt and find the DLLs for the platform you are targeting
  3. Copy them into your application's program directory

They are not big. About 2 megabytes in total.

I ended up using this technique because:

  • It does not require me to create a separate WiX package and then bootstrap them;
  • It does not require the user to run any extra installers

I cannot speak to whether it would work on all computers, but it works on the ones I have tested.

Jaban answered 7/7, 2017 at 21:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.