I was banging my head against the wall today trying to figure out a compatible way between Windows XP and Vista to detect if MSVCRT 8 runtime was installed using NSIS. I wanted to do this because I want to avoid downloading that component if the user's PC already has that version installed; this is especially important for update scenarios. Finally I figured out a very simple way to do it, just wildcard check for the existence of a specific versioned directory in the WinSxS folder:
Function IsMsvcrt8Installed
FindFirst $R1 $R0 "$WINDIR\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762*"
${If} $R0 != ""
DetailPrint "MSVCRT 8.0 is installed."
StrCpy $R0 1
${Else}
DetailPrint "MSVCRT 8.0 is not installed."
StrCpy $R0 0
${EndIf}
Push $R0
FunctionEnd