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:
; IsMsvcrt8Installed ; ; Checks target machine for MSVCRT 8.0.50727.762 runtime installed in Windows ; SxS DLL cache. ; ; Returns 1 if found, otherwise 0 Function IsMsvcrt8Installed ; we can assume version because SxS directory is version specific 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
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, Shawn Neal
E-mail