nsis 检测vcredist_x86是否安装?

南北桥 发布于 2012/08/16 14:13
阅读 3K+
收藏 0

做个安装包,需要检测客户机是否安装了vcredist_x86环境,nsis脚本怎么去检测vc是否安装,(重点是我找不到vcredist在注册表的信息)

加载中
0
helloworld_go
helloworld_go
;-------------------------------
; 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

南北桥
南北桥
嗯。我vcredist_x86的MD5编码是 "FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4" 之前不知道去哪里找那个注册表信息,现在好了 代码也测试过了,3Q!!
0
helloworld_go
helloworld_go

;------------------------------- ; 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


不同的版本这个地方不一样,自己找一下。

0
helloworld_go
helloworld_go
;------------------------------- ; 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
返回顶部
顶部