4
votes

How to detect if Visual C++ Redistributable for Visual Studio 2013 is installed?

I'm using Nullsoft NSIS Installer System but only I need Windows Registry entry

I have googled, and looked at other StackOverflow questions. In particular, this Detect if Visual C++ Redistributable for Visual Studio 2012 is installed provides the exact Registry key to check, but for the case of VS 2012.

1
Can't you just launch a silent install (which will do nothing if already installed) ? You'll need to ship the installer either way... - Calvin1602
I only need windows registry entries for check Visual C++ version - Ivan Rodriguez
I find it easier to just always install vs. checking for installation for the VC Redist installers. The process is usually very fast if already installed. - crashmstr
@crashmstr exactly... OP, can you explain why you want to know if it's installed ? - Calvin1602
The dll can't be included in the installer for business requirement. ;( - Ivan Rodriguez

1 Answers

6
votes

My solution with NSIS system:

ReadRegDword $R1 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\VC\Runtimes\x64" "Installed"
ReadRegDword $R2 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\VC\Runtimes\x86" "Installed"
${If} $R1 != "1"
    ${AndIf} $R2 != "1"
        !insertmacro Log "Error: VisualStudio DLLs to the standard package (C++) 2013 is required!!"
        !insertmacro Log "Setup was not completed successfully."
        SetDetailsView show
        Abort 
    ${Else}
    !insertmacro Log "VisualStudio DLLs to the standard package (C++) 2013 is installed."

${EndIf}