Three new macros were added to 'WinVer.nsh' to support Windows service pack versions in addition to Windows versions.
New macros:
AtLeastServicePack
IsServicePack
AtMostServicePack
Example:
${If} ${IsWin2000}
${AndIf} ${AtLeastServicePack} 3
${OrIf} ${AtLeastWinXP}
DetailPrint "Running Win2000 SP3 or above
${EndIf}
Have fun!
Marius Negrutiu (marius.negrutiu@gmail.com)
Modified WinVer.nsh
Logged In: YES
user_id=2168248
Originator: NO
A small correction to the previously submitted WinVer.nsh
------------------------------------------------------------>>
!macro __GetWinServicePack
!insertmacro _LOGICLIB_TEMP
Push $2
Push $0
Push $1
StrCpy $2 0
; $1 = malloc(sizeof(OSVERSIONINFOEXA))
System::Alloc 156
Pop $1
StrCmp $1 0 +6
; ($1)->dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA)
System::Call /NOUNLOAD '*$1(&i4 156)'
; GetVersionEx($1)
System::Call /NOUNLOAD 'kernel32::GetVersionEx(i *$1) i.r0'
StrCmp $0 0 +2
; $2 = ($1)->wServicePackMajor
System::Call /NOUNLOAD '*$1(&t148, &i2.r2)'
System::Free $1
StrCpy $_LOGICLIB_TEMP $2
Pop $1
Pop $0
Pop $2
!macroend
<<----------------------------------------------------------
Logged In: YES
user_id=584402
Originator: NO
Thanks, added with some minor changes including move to LogicLib to avoid the relative jumps.
Logged In: YES
user_id=2168248
Originator: NO
Thanks for adding it to NSIS, but removing the relative jumps rendered the macro uncompilable.
The error message says: "macro "_If" already being inserted!"