From 0ab9548200a0bc81143872d2cbca3565aeb95730 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 15 Aug 2008 18:50:39 +0000 Subject: [PATCH] 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 --- Include/WinVer.nsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Include/WinVer.nsh b/Include/WinVer.nsh index 949eae84..7b91bae5 100644 --- a/Include/WinVer.nsh +++ b/Include/WinVer.nsh @@ -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}