NSIS――检测SQL Server安装版本 2011-10-14 09:21:19| 分类: 技术―NSIS | 标签: |字号大
中
小 订阅
来自:http://nsis.sourceforge.net/How_to_tell_what_version_of_SQLServer_is_installed
1、代码如下:
Function StrTok
Exch $R1
Exch 1
Exch $R0
Push $R2
Push $R3
Push $R4
Push $R5
;R0 fullstring
;R1 tokens
;R2 len of fullstring
;R3 len of tokens
;R4 char from string
;R5 testchar
StrLen $R2 $R0
IntOp $R2 $R2 + 1
loop1:
IntOp $R2 $R2 - 1
IntCmp $R2 0 exit
StrCpy $R4 $R0 1 -$R2
StrLen $R3 $R1
IntOp $R3 $R3 + 1
loop2:
IntOp $R3 $R3 - 1
IntCmp $R3 0 loop1
StrCpy $R5 $R1 1 -$R3
StrCmp $R4 $R5 Found
Goto loop2
Goto loop1
exit:
;Not found!!!
StrCpy $R1 ""
StrCpy $R0 ""
Goto Cleanup