4

When my file set includes DLLs with one ore more dependencies to the C++ run-time DLLs I need to install the file from VCRedist.exe. This can be difficult, since each DLL is dependent on a specific version of the C++ run-time.

  • How do I add automatically the run-time redistributables to my installer?

  • How do I handle DLLs that require different versions of the C++ run-time in the WinSxS?

Dialecticus
  • 16,400
  • 7
  • 43
  • 103
harper
  • 13,345
  • 8
  • 56
  • 105

3 Answers3

1

You need to install the latest version (highest) version required by your libraries and a policy file that redirects older versions to the new version.

You can do both with merge modules installed with Visual Studio. They're usually located in C:\Program Files\Common Files\Merge Modules. See MergeRef element and an example how to install Visual C++ redistributable with your installer. You will also need to add a policy merge module to your install.

Alexey Ivanov
  • 11,541
  • 4
  • 39
  • 68
0

You can simple make sure the latest vcredist is installed, it automatically includes support for older versions.

I think the easiest it to use bootstrapper to install the runtime before your installer runs. You might need to create your own package, but it is easy to use Bootstrapper Manifest Generator for this.

In the product.xml you can add an installation check to make sure it is not installed twice, for example:

  <InstallChecks>
    <MsiProductCheck Property="VCRedistInstalled" Product="{1F1C2DFC-2D24-3E06-BCB8-725134ADF989}"/>
  </InstallChecks>

See here for other GUIDs.

Community
  • 1
  • 1
wimh
  • 15,072
  • 6
  • 47
  • 98
  • There is no support from 'heat' or Votive to detect this? I should manage the .wxs files after detection, but an initial creation of a fragment would be appreciated. – harper May 17 '11 at 08:38
  • A bootstrapper is not part of wix, so you can't use heat for this. See for example `C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\*` or `C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\*` for existing files. Use BMG to create such a file. – wimh May 17 '11 at 09:57
  • I don't necessarely need a bootstrapper. In the WiX.CHM section "How To: Install the Visual C++ Redistributable with your installer" you find how to include the merge module. This is part of WiX and I seek for a way to get this more convenient and less error prone. – harper May 17 '11 at 14:03
  • You can use a merge module too, as suggested by Alexey Ivanov. But I stopped using that because I had too often warnings in wix caused by the merge modules. However, the merge modules were working fine. – wimh May 17 '11 at 15:54
0

Neither heat nor Votive does support the requested feature. The run-time DLLs must be added manually.

harper
  • 13,345
  • 8
  • 56
  • 105