added service pack support for old versions of nt that didn't support OSVERSIONINFOEX

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5703 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-08-15 18:50:39 +00:00
parent 7c7f065856
commit 0ab9548200

View file

@ -177,6 +177,21 @@
${If} $0 <> 0
; $2 = ($1)->wServicePackMajor
System::Call /NOUNLOAD '*$1(&t148, &i2.r2)'
${Else}
; ($1)->dwOSVersionInfoSize = sizeof(OSVERSIONINFOA)
System::Call /NOUNLOAD '*$1(&i4 148)'
; GetVersionEx($1)
System::Call /NOUNLOAD 'kernel32::GetVersionEx(i $1) i.r0'
${If} $0 <> 0
; $2 = ($1)->szCSDVersion
System::Call /NOUNLOAD '*$1(&t20, &t128.r2)'
StrCpy $0 $2 13
${If} $0 == "Service Pack "
StrCpy $2 $2 "" 13
${Else}
StrCpy $2 0
${EndIf}
${EndIf}
${EndIf}
System::Free $1
${EndIf}