1

I have an .msi installer developed using wix that installs some dlls in a directory on the file system. Some of these dlls have dependency on Visual C++ Redistributable Packages for Visual Studio 2013. I am wondering that is it possible to install that run time (downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=40784) during my installer's installation process? - that is while the .msi installer is running and copying dlls, it will install the MSVC run time at the same time for the user.

I want to know if this is possible.. If it is, is this generally a good or bad practice? Should it be enough to just copy the MSVCP120.dll and MSVCR120.dll along with all other dlls? Thanks.

zfgo
  • 195
  • 11

1 Answers1

1

VC++ Runtime: The Visual C++ runtime can be installed via merge modules (basics) inside the MSI (there are some limitations with later versions of the runtime) or as an executable on its own (vcredist_x86.exe or vcredist_x64.exe), generally installed before your main MSI (latest C++ downloads).

Setup.exe: You can bundle such a runtime installer inside a setup.exe made with WiX's Burn feature (Hello Burn example - it is a bootstrapper, chainer, launcher - runs installs in sequence) or a similar feature in InstallShield (suite projects), Advanced Installer or other packaging tools. Some resources: More on Burn and Making setup.exe launchers.

Universal CRT: As stated in this answer, it is recommended to use the vcredist_x86.exe or vcredist_x64.exe installers instead of the merge modules due to the "Universal CRT" components not being installed properly with the merge modules. "Universal CRT" relates to Visual C++ support for Universal Apps built for the Universal Windows Platform.

Single File Copy: Please avoid copying single files to the location application folder. This is important in order to be able to rely on system-wide security fixes for the C++ runtime (coming down from Windows Update or installed in other ways).


Links:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • thanks for your reply, I think I am going to go with the bootstrapper approach. Regarding checking if the run time is already installed, I came across one of your posts: https://stackoverflow.com/questions/53638587/wix-per-user-installer-to-detect-the-visual-c-2015-redistributable, which is also very helpful. – zfgo May 04 '21 at 14:32
  • I wrote that a few years ago, and it might be helpful, but it is also quite a mess. I didn't find any super reliable approaches back then - usually that means there is a better way, but I am not aware of one at this stage. Perhaps there is a API-call from Windows itself that can report it? There probably is - or maybe WMI / Powershell? Maybe I should check and update the answer. Will have to do that later. Maybe check my experimental ["Jumpgate"](https://installdude.com/jumpgate.php) for more help resources. [Main site](https://installdude.com/). – Stein Åsmul May 04 '21 at 16:13