VC 8.0 Redistributables: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Vc8redist moved to VC 8.0 Redistributables: Changing page title to something more reasonable)
(Added note about DLLs and a link to a related article)
Line 15: Line 15:
     Exch $R0
     Exch $R0
  FunctionEnd
  FunctionEnd
It should be noted that the DLLs could be installed even if the redistributable isn't installed. One example would be if the user has Visual Studios installed, then they have the dlls without the redist.
== Related articles ==
[[WinSxS QueryAssemblyInfo to check if assembly is installed]]


[[Category:Other Products Handling Functions]]
[[Category:Other Products Handling Functions]]
[[Category:Other Products Version Detection Functions]]
[[Category:Other Products Version Detection Functions]]

Revision as of 10:38, 31 May 2008

This function detects if VC++ 8.0 redistributables are installed on the machine

;-------------------------------
; Test if Visual Studio Redistributables 2005+ SP1 installed
; Returns -1 if there is no VC redistributables intstalled
Function CheckVCRedist
   Push $R0
   ClearErrors
   ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7299052b-02a4-4627-81f2-1818da5d550d}" "Version"

   ; if VS 2005+ redist SP1 not installed, install it
   IfErrors 0 VSRedistInstalled
   StrCpy $R0 "-1"

VSRedistInstalled:
   Exch $R0
FunctionEnd

It should be noted that the DLLs could be installed even if the redistributable isn't installed. One example would be if the user has Visual Studios installed, then they have the dlls without the redist.

Related articles

WinSxS QueryAssemblyInfo to check if assembly is installed