Added GetWinVer instruction
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7309 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
cdffbfe870
commit
52d6782447
14 changed files with 257 additions and 31 deletions
|
@ -202,6 +202,54 @@
|
|||
|
||||
# lazy initialization macro
|
||||
|
||||
!define /IfNDef __WinVer_GWV GetWinVer
|
||||
|
||||
!macro __WinVer_InitVars_NEW
|
||||
!insertmacro __WinVer_DeclareVars
|
||||
|
||||
# only calculate version once
|
||||
StrCmp $__WINVERV "" _winver_noveryet
|
||||
Return
|
||||
_winver_noveryet:
|
||||
|
||||
Push $0
|
||||
${__WinVer_GWV} $0 Product
|
||||
${__WinVer_GWV} $__WINVERV NTDDIMajMin
|
||||
IntOp $__WINVERV $__WINVERV << 16 ; _WINVER_MASKVMAJ & _WINVER_MASKVMIN
|
||||
IntOp $__WINVERSP $0 & 2
|
||||
IntOp $__WINVERSP $__WINVERSP << 29 ; _WINVER_NTSRVBIT & _WINVER_NTDCBIT
|
||||
|
||||
${If} $__WINVERSP <> 0 ; Server?
|
||||
${If} $__WINVERV U>= 0x06000000
|
||||
${AndIf} $__WINVERV U< 0x09000000
|
||||
IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT} ; Extra bit so Server 2008 comes after Vista SP1 that has the same minor version, same for Win7 vs 2008R2
|
||||
${EndIf}
|
||||
${Else}
|
||||
${If} $__WINVERV = 0x05020000
|
||||
StrCpy $__WINVERV 0x05010000 ; Change XP 64-bit from 5.2 to 5.1 so it's still XP
|
||||
${EndIf}
|
||||
${EndIf} ;~ Server
|
||||
|
||||
${If} $0 <> 0 ; WNT?
|
||||
!if "${NSIS_PTR_SIZE}" <= 4
|
||||
!ifdef WINVER_NT4_OVER_W95
|
||||
${If} $__WINVERV = 0x04000000
|
||||
IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT} ; change NT 4.0.reserved.0 to 4.0.reserved.1
|
||||
${EndIf}
|
||||
!endif
|
||||
!endif
|
||||
IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTBIT} ; _WINVER_NTBIT
|
||||
IntOp $__WINVERV $__WINVERV | ${_WINVER_NTBIT} ; _WINVER_NTBIT
|
||||
${EndIf} ;~ WNT
|
||||
|
||||
${__WinVer_GWV} $0 Build
|
||||
IntOp $__WINVERSP $__WINVERSP | $0 ; _WINVER_MASKVBLD
|
||||
${__WinVer_GWV} $0 ServicePack
|
||||
IntOp $0 $0 << 16
|
||||
IntOp $__WINVERSP $__WINVERSP | $0 ; _WINVER_MASKSP
|
||||
Pop $0
|
||||
!macroend
|
||||
|
||||
!ifmacrondef __WinVer_Call_GetVersionEx
|
||||
|
||||
!macro __WinVer_Call_GetVersionEx STRUCT_SIZE
|
||||
|
@ -213,7 +261,7 @@
|
|||
|
||||
!endif
|
||||
|
||||
!macro __WinVer_InitVars
|
||||
!macro __WinVer_InitVars_OLD
|
||||
# variables
|
||||
!insertmacro __WinVer_DeclareVars
|
||||
|
||||
|
@ -389,6 +437,14 @@
|
|||
|
||||
!macroend
|
||||
|
||||
!macro __WinVer_InitVars
|
||||
!ifndef WinVer_v3_7
|
||||
!insertmacro __WinVer_InitVars_NEW
|
||||
!else
|
||||
!insertmacro __WinVer_InitVars_OLD
|
||||
!endif
|
||||
!macroend
|
||||
|
||||
# version comparison LogicLib macros
|
||||
|
||||
!macro _WinVerAtLeast _a _b _t _f
|
||||
|
@ -452,9 +508,13 @@
|
|||
# service pack macros
|
||||
|
||||
!macro _WinVer_GetServicePackLevel OUTVAR
|
||||
!ifndef WinVer_v3_7
|
||||
${__WinVer_GWV} ${OUTVAR} ServicePack
|
||||
!else
|
||||
${CallArtificialFunction} __WinVer_InitVars
|
||||
IntOp ${OUTVAR} $__WINVERSP & ${_WINVER_MASKSP}
|
||||
IntOp ${OUTVAR} ${OUTVAR} >> 16
|
||||
!endif
|
||||
!macroend
|
||||
!define WinVerGetServicePackLevel '!insertmacro _WinVer_GetServicePackLevel '
|
||||
|
||||
|
@ -492,6 +552,7 @@
|
|||
!define IsStarterEdition `${SM_STARTER} WinVer_SysMetricCheck ""`
|
||||
!define OSHasMediaCenter `${SM_MEDIACENTER} WinVer_SysMetricCheck ""`
|
||||
!define OSHasTabletSupport `${SM_TABLETPC} WinVer_SysMetricCheck ""`
|
||||
!define IsSafeBootMode `67 WinVer_SysMetricCheck ""`
|
||||
|
||||
# version retrieval macros
|
||||
|
||||
|
@ -509,7 +570,14 @@
|
|||
|
||||
!define WinVerGetMajor '!insertmacro __WinVer_GetVer $__WINVERV 24 ${_WINVER_MASKVMAJ}'
|
||||
!define WinVerGetMinor '!insertmacro __WinVer_GetVer $__WINVERV 16 ${_WINVER_MASKVMIN}'
|
||||
!ifndef WinVer_v3_7
|
||||
!macro __WinVer_GetVerBuild outvar
|
||||
${__WinVer_GWV} ${outvar} Build
|
||||
!macroend
|
||||
!define WinVerGetBuild '!insertmacro __WinVer_GetVerBuild '
|
||||
!else
|
||||
!define WinVerGetBuild '!insertmacro __WinVer_GetVer $__WINVERSP "" ${_WINVER_MASKVBLD}'
|
||||
!endif
|
||||
|
||||
!macro _WinVer_BuildNumCheck op num _t _f
|
||||
!insertmacro _LOGICLIB_TEMP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue