If you try and install the vs2015 redistributable on windows 8.1 without any updates, it will fail to install. But it will get far enough into the install process that the guid is in the registry so if you run a program that checks for the existence of the redistributable in the registry, you'll get past that check.
If you then try and run a program compiled with vs2015 that requires some of the dlls that failed to install, you'll get a popup that says "The program can't start because..." you know the drill.
I'm working on an installer (with NSIS) that is having this problem, and I'm trying to find a way to detect the dll missing problem before I run the .exe and get the popup. Is there any command line tool I can run or any NSIS function I can call that will clue me into this problem before it happens?
Or even a way to check if the vs2015 redistributable installed correctly? (without having to check for the existence of every single file in the redistributable, because I don't know what they all are.)
Looking for any ideas to solve the overall problem, not necessarily to specifically get past this one check. I expect there can be all sorts of ways the redistributable can fail to install.
I believe VS2015 is one of the versions that installs the .DLLs in System32 without WinSxS so you could perhaps just check if vcruntime140.dll & msvcp140.dll is in
$SysDir
.If you are worried that it might be a partial install you could see if you can load it (assuming your installer matches the bitness of the thing you are installing):
This might be considered a bit of a hack but it might be enough for your needs. Dependency Walker will tell you which DLLs to look for.
You can also call
MsiGetProductInfo
with NSIS if you wish:This blog post says that Visual Studio 2005 uses
MsiQueryProductState
and that is probably a nice simple alternative if you don't need any more details: