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

前端 未结 3 1667
感动是毒
感动是毒 2020-12-03 21:04

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 W

相关标签:
3条回答
  • 2020-12-03 21:45

    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>
    

    0 讨论(0)
  • 2020-12-03 21:45

    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.

    0 讨论(0)
  • 2020-12-03 21:52

    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.

    0 讨论(0)
提交回复
热议问题