PDA

View Full Version : Visual C++ 2015 Redist not installing when selected



Andrew@Argus
07-20-2017, 11:48 AM
We have had issues on several computers where the Visual C++ 2015 Redist did not install. This does not happen on every computer. I traced the problem to being the condition that is being tested (msvcp140.dll). It appears that this can exist without the rest of the Visual C++ 2015 redist being there. In particular the mfc140.dll was missing.

Changed the condition to testing for mfc140.dll and I was able to get the Redist installer to come active (and the EXE ran after).

Is this the correct way to do this or is there a better way of determining this? I noticed on another website that there was a mention that this had already been changed - was originally looking at a Registry Key. There has to be a better way of determining this. Otherwise need to be able to check for all of the DLLs that are part of the Redist.

HookEm
07-26-2017, 09:42 AM
Hope this saves someone else the trouble I've just gone through to figure this out.

Anyway, we had the same problem immediately after releasing our product. It appears that having the pre-requisite key off locating a particular version of "msvcp140.dll" is the problem. After reviewing several customer machines, it appears there are numerous third party applications that are incorrectly (and in violation of the VS 2015 license) copying "msvcp140.dll" directly to the system folder instead of using the redistributable package provided by Microsoft (and run by the InstallShield redistributable). I found several references to using the version specified in the registry location below instead of locating msvcp140.dll. That seems to work for me.

This site describes how to fix the pre-req to use the registry key value instead of searching for msvcp140.dll: http://www.firedaemon.com/blog/fixing-installshields-visual-c-2015-runtime-preqrequisite

(http://www.firedaemon.com/blog/fixing-installshields-visual-c-2015-runtime-preqrequisite)Registry Key (Note 32-bit redistributable will need to key off the location under WOW6432Node on a 64-bit system):
Key Name: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeMinimum
Value Name: Version

Make sure you check for the correct version based on what version of VS 2015 your application is compiled against. To make matters worse, Microsoft keeps re-releasing the "Update 3" version of the VC++ 2015 runtime and not telling anyone. There have been 3 versions of "Update 3" release so far that I know of: 14.0.24210.0, 14.0.24212.0, and 14.0.24215.1 (the latest as of a few days ago). Check the version of the install file that you are repackaging (vc_redist.x86.exe and/or vc_redist.x64.exe).

Hysteresis
07-28-2017, 06:20 AM
Very useful info HookEm.

I hadn't appreciated MS was releasing multiple copies of update 3. We had a similar VC++ 2015 redist install detect problem and was using the DLL check. We've now switched to the reg key check method.

One other issue we discovered was that installing update 3 on systems that already contained an earlier version of the redist occasionally caused the host machine to reboot. This was very undesirable behaviour...

We now leave the original redist installed if detected and don't upgrade it. Our products 'should' be comptaible all versions of the redist.

Again thanks for the heads up.