View Single Post
Old 22nd April 2016, 16:04   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,296
You could probably find a usable registry entry to check but I would rather check the version of system files with something like this:

PHP Code:
/*!macro _WinVerCustomMakeDllVer a b c d
IntOp $1 ${a} << 16
IntOp $2 ${b} & 0x0000ffff
IntOp $3 ${c} << 16
IntOp $4 ${d} & 0x0000ffff
IntOp $1 $1 | $2
IntOp $3 $3 | $4
IntFmt $1 "0x%.8x" $1
IntFmt $3 "0x%.8x" $3
DetailPrint "DEBUG: ${a}.${b}.${c}.${d} = $1 $3"
!macroend*/

!macro _WinVerCustom_AtLeastDllVer _a _b _t _f
!insertmacro _LOGICLIB_TEMP
Push 
$0
GetDLLVersion 
"$SysDir\KERNEL32.DLL" $0 $_LOGICLIB_TEMP
IntCmpU 
${_a} $"" ++3
IntCmpU 
${_b$_LOGICLIB_TEMP "" "" +2
StrCpy $_LOGICLIB_TEMP 
"+"
Pop $0
!insertmacro _== $_LOGICLIB_TEMP "+" `${_t}` `${_f}`
!
macroend
!define SysDllAtLeastWinXPSP2 `0x00050001 WinVerCustom_AtLeastDllVer 0x0a280884`
!
define SysDllAtLeastWin8SP0  `0x00060002 WinVerCustom_AtLeastDllVer 0`


!include 
LogicLib.nsh
Section
${If} ${SysDllAtLeastWinXPSP2}
    
DetailPrint "Ready Go"
${Else}
    
DetailPrint "Wait A Minute"
    
Quit
${EndIf}
SectionEnd 
(I just threw this together and did not test much)

It would not surprise me if this HIPS application has decided to block all executables in %Temp%...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote