Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use vcredist.exe or the msm's to install the Visual C++ runtime library

What are the pluses and minuses to using the vcredist.exe versus the msm files to install the Visual C++ 8.0 runtime libraries?

like image 361
Adam Tegen Avatar asked Jul 27 '09 19:07

Adam Tegen


4 Answers

Merge Modules can not be updated (unless they solved that in Windows Installer) once they are installed, so my advice would be to stick with vcredist.exe.

like image 70
ZippyV Avatar answered Nov 01 '22 04:11

ZippyV


Another issue with the merge modules I recently bumped into is that they set the MSI installer property ALLUSERS to 1 which means per-machine. That forces your whole install to be per-machine, which is a problem if you want it to be per-user. Whether there's a way to have a per-user installer that includes a CRT merge module I don't know, but I haven't found it yet.

like image 27
Jim Avatar answered Nov 01 '22 02:11

Jim


One downside to the merge modules is that you can't deploy multiple versions of the VC80 or VC90 merge module in the same msi because the file identifiers overlap. You can deploy one of each though. So for example, if you wanted to deploy the RTM version of VC80 and the SP1 version, you will get errors if they are in the same msi (I use WiX).

Another issue, build behavior is different between VS 2005/2008 as it pertains to applying a service pack or update.

2005 If you install service pack 1 on your build machine, your program will automatically link against the updated files. The service pack will also update the merge modules, so provided you're pointing your installer to use the updated files, you're fine. However, this can be an issue if you're using third party compiled static libs that may require an older version of the runtime specifically.

2008 The behavior here is the exact opposite. If you install SP1, the merge modules are updated to the SP1 level, but your program will compile against the RTM versions unless you set a per-project preprocessor macro: _BIND_TO_VCLIBS_CURRENT_VERSION=1. This can be set either in stdafx.h or in the "Preprossor definitions" for your project, or if you're using an old nmake project, you will have to pass it wherever your command line options are, such as CFLAGS.

This means that if you're using the msm provided by visual studio, and you apply SP1, your project deployment is broken until you define the macro.

Another caveat to the macro: if you're using a 2005 project that links against a 2008 static lib, setting the macro will break the 2005 project, due to the symbol not existing in the 2005 version of the compiler. In this case I usually split the project I'm linking against into a 2005 and 2008 version of the solution.

like image 5
Brian Avatar answered Nov 01 '22 03:11

Brian


To point out the obvious, Merge Modules are not really a good solution if you aren't going to use an MSI installer. Vcredist is absurdly simple to use regardless of the install process you are using.

like image 3
Brian Avatar answered Nov 01 '22 04:11

Brian