From f1cd86519086f0417c4a6de32835e82e8ee548a3 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 29 Nov 2008 21:03:55 +0000 Subject: [PATCH] make ${WinVerGetServicePackLevel} accept an output variable again git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5807 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/WinVer.nsh | 16 +++++++++------- Source/Tests/winver.nsi | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Include/WinVer.nsh b/Include/WinVer.nsh index a0ee54c4..831b97fb 100644 --- a/Include/WinVer.nsh +++ b/Include/WinVer.nsh @@ -405,28 +405,30 @@ # service pack macros -!macro _WinVer_GetServicePackLevel - !insertmacro _LOGICLIB_TEMP +!macro _WinVer_GetServicePackLevel OUTVAR ${CallArtificialFunction} __WinVer_InitVars - IntOp $_LOGICLIB_TEMP $__WINVERSP & ${_WINVER_MASKSP} - IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP >> 16 + IntOp ${OUTVAR} $__WINVERSP & ${_WINVER_MASKSP} + IntOp ${OUTVAR} ${OUTVAR} >> 16 !macroend !define WinVerGetServicePackLevel '!insertmacro _WinVer_GetServicePackLevel ' !macro _AtLeastServicePack _a _b _t _f - ${WinVerGetServicePackLevel} + !insertmacro _LOGICLIB_TEMP + ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP !insertmacro _>= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}` !macroend !define AtLeastServicePack `"" AtLeastServicePack` !macro _AtMostServicePack _a _b _t _f - ${WinVerGetServicePackLevel} + !insertmacro _LOGICLIB_TEMP + ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP !insertmacro _<= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}` !macroend !define AtMostServicePack `"" AtMostServicePack` !macro _IsServicePack _a _b _t _f - ${WinVerGetServicePackLevel} + !insertmacro _LOGICLIB_TEMP + ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP !insertmacro _= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}` !macroend !define IsServicePack `"" IsServicePack` diff --git a/Source/Tests/winver.nsi b/Source/Tests/winver.nsi index bf74f01f..6537ec76 100644 --- a/Source/Tests/winver.nsi +++ b/Source/Tests/winver.nsi @@ -239,11 +239,11 @@ Var OSVERSIONINFOEX_INIT ${OrIf} ${IsServicePack} $0 ${OrIf} ${IsServicePack} $1 - !insertmacro _WinVer_GetServicePackLevel + ${WinVerGetServicePackLevel} $2 DetailPrint "Service pack detection failed for ${NAME}" DetailPrint " Expected: ${SP}" - DetailPrint " Got: $_LOGICLIB_TEMP" + DetailPrint " Got: $2" StrCpy $R0 "FAILURE"