上一页 | 目录 | 下一页
C.1 获取 Internet Explorer 版本
; GetIEVersion
;
; 基于 Yazno's 的函数,http://yazno.tripod.com/powerpimpit/
; 返回到堆栈顶
; 1-6 (已安装的 IE 版本)
; or
; '' (IE 未安装)
;
; 用法:
; Call GetIEVersion
; Pop $R0
; ; 在这里 $R0 为 "5" 或其它
Function GetIEVersion
Push $R0
ClearErrors
ReadRegStr $R0 HKLM "Software\Microsoft\Internet Explorer" "Version"
IfErrors lbl_123 lbl_456
lbl_456: ; ie 4+
Strcpy $R0 $R0 1
Goto lbl_done
lbl_123: ; 老版本 IE
ClearErrors
ReadRegStr $R0 HKLM "Software\Microsoft\Internet Explorer" "IVer"
IfErrors lbl_error
StrCpy $R0 $R0 3
StrCmp $R0 '100' lbl_ie1
StrCmp $R0 '101' lbl_ie2
StrCmp $R0 '102' lbl_ie2
StrCpy $R0 '3' ; 如果不是 100、101 或 102 则默认为 IE3
Goto lbl_done
lbl_ie1:
StrCpy $R0 '1'
Goto lbl_done
lbl_ie2:
StrCpy $R0 '2'
Goto lbl_done
lbl_error:
StrCpy $R0 ''
lbl_done:
Exch $R0
FunctionEnd
上一页 | 目录 | 下一页