Wireshark-dev: [Wireshark-dev] Visual C++ 2019 redistributable - giveth and taketh

From: chuck c <bubbasnmp@xxxxxxxxx>
Date: Mon, 7 Jun 2021 14:58:51 -0500
Wireshark.exe - System Error
--------------------------
The code execution cannot proceed because MSVCP140.dll was not found.
Reinstalling the program may fix the problem.  
  
No, you're not losing it. The file(s) did disappear.

Installers built with current Visual Studio get a vcredist_x64.exe that does not include msvcp140.dll (and others).

  -- Using C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.29.30036\vcredist_x64.exe for the NSIS installer.  

When the Wireshark installer calls vcredist_x64.exe,  the existing files are deleted.

Before install:
C:\>dir \windows\system32\msvcp140*dll
 Volume in drive C has no label.
 Volume Serial Number is 12C4-AC21

 Directory of C:\windows\system32

05/19/2021  05:06 PM           565,640 msvcp140.dll
05/19/2021  05:06 PM           919,944 msvcp140d.dll
05/19/2021  05:06 PM           111,496 msvcp140d_atomic_wait.dll
05/19/2021  05:06 PM            24,456 msvcp140d_codecvt_ids.dll
05/19/2021  05:06 PM            23,944 msvcp140_1.dll
05/19/2021  05:06 PM            29,064 msvcp140_1d.dll
05/19/2021  05:06 PM           185,736 msvcp140_2.dll
05/19/2021  05:06 PM           380,296 msvcp140_2d.dll
05/19/2021  05:06 PM            56,192 msvcp140_atomic_wait.dll
12/07/2019  04:10 AM           622,832 msvcp140_clr0400.dll
05/19/2021  05:06 PM            20,360 msvcp140_codecvt_ids.dll
              11 File(s)      2,939,960 bytes
               0 Dir(s)  40,175,132,672 bytes free

After install:
C:\>dir \windows\system32\msvcp140*dll
 Volume in drive C has no label.
 Volume Serial Number is 12C4-AC21

 Directory of C:\windows\system32

05/19/2021  05:06 PM           919,944 msvcp140d.dll
05/19/2021  05:06 PM           111,496 msvcp140d_atomic_wait.dll
05/19/2021  05:06 PM            24,456 msvcp140d_codecvt_ids.dll
05/19/2021  05:06 PM            29,064 msvcp140_1d.dll
05/19/2021  05:06 PM           380,296 msvcp140_2d.dll
12/07/2019  04:10 AM           622,832 msvcp140_clr0400.dll
               6 File(s)      2,088,088 bytes
               0 Dir(s)  40,174,395,392 bytes free

C:\>

Does not affect buildbot which is using an older version:
-- Using C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Redist\MSVC\14.28.29910\vcredist_x64.exe for the NSIS installer.


https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0

"For example, installing the Visual C++ 2019 redistributable will affect programs built with Visual C++ 2015 and 2017 also. 
However, installing the Visual C++ 2015 redistributable will not replace the newer versions of the files installed by the Visual C++ 2017 and 2019 redistributables."