1

I would like to add VC++ Redistributable 2013 to an existing working WiX project. The project consists of one main file with a <Product> element, which contains a <Feature> and an <InstallExecuteSequence> element and some others.

I found out that you can use <ExePackage> from Burn to install an .exe file (in my case the redistributable). I formed a fragment, which looks like this (with help from here):

<Fragment>
    <PackageGroup Id="VC13RedistX86">
      <ExePackage
        Cache="no"
        Compressed="yes"
        PerMachine="yes"
        Permanent="yes"
        Vital="yes"
        Name="Resources\vcredist_x86.exe"
        SourceFile="Resources\vcredist_x86.exe"
        InstallCommand="/install /quiet /norestart">

        <!-- -->
        <ExitCode Value="3010" Behavior="forceReboot"/>
        <!-- Ignore "Newer version installed" error -->
        <ExitCode Value="1638" Behavior="success"/>
      </ExePackage>
    </PackageGroup>
</Fragment> 

I would like to know if there is a way to include this into my existing WiX product or no? If there is no way, how can I combine the original installer and the <ExePackage>?

AndrejH
  • 2,028
  • 1
  • 11
  • 23
  • 1
    [Some details on why MSI files can not be installed concurrently](https://stackoverflow.com/a/51274911/129130). – Stein Åsmul Jul 12 '18 at 15:42
  • @SteinÅsmul Can you maybe suggest a way how I could do this? Should I build an `.exe` installer for my app, then make a MSI to install both the VC++ redist and my app? – AndrejH Jul 13 '18 at 09:28

2 Answers2

5

ExePackage is valid only in a bundle (.exe), not a product (.msi). (The VC++ redistributable is itself a Burn bundle containing MSI packages and MSI packages can't install other MSI packages.)

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • Does this mean that I should create an .exe installer for my app, then make an MSI installer that will install both the VC++ Redistributable and my app? – AndrejH Jul 13 '18 at 09:25
  • 2
    Make an MSI package for your app and add it and the VC++ redist package to a bundle (.exe). – Bob Arnson Jul 13 '18 at 13:59
0

The best way to add your vc redist binaries to the installation is to use the merge modules supplied by Microsoft although they now recommend using a bootstrapper and installing the redistributable packages themselves instead of using merge modules.

See this microsoft topic for more information about Redistributing Visual C++ Files.

Brian Sutherland
  • 4,698
  • 14
  • 16
  • For Visual Studio 2019 and later, using merge modules for the Visual C++ Redistributable files are deprecated. [Redistributing components by using merge modules](https://learn.microsoft.com/en-us/cpp/windows/redistributing-components-by-using-merge-modules?view=msvc-170) – Tagman Jul 03 '23 at 12:53