Archive: Possible to detect Hyper Threading?


Possible to detect Hyper Threading?
EDIT: Actually I know how to find it I just don't know how to have the installer discover it.

The hyper-threaded kernel file is originally named ntkrnlmp.exe but when it's copied to a HT machine it's renamed to ntoskrnl.exe. However in the Version tab in the Original Filename field it still says "ntkrnlmp.exe"

How can I get the installer to read that value into a variable?


Okay it turns out I found the solution using the sysinfo.dll plugin.

I searched the NSIS Archive for sysinfo and it didn't find anything, but in the actual Downloads section it was listed alphabetically.

The original demo code was designed to use macros to pass parameters and it required physically extracting the dll to a temp directory. I moddified the code however to work without macros for my instance, and to use the plugin call. Here is the code if anyone is interested:

Name "Kernel Type Detection"
OutFile "Kernel Detect.exe"
ShowInstDetails show

Section ""
Push "$SYSDIR\ntoskrnl.exe"
Push "OriginalFilename"
sysinfo::GetFileVersionValue
Pop $9

StrCmp $9 "ntkrnlmp.exe" "" +3
MessageBox MB_OK "Hyper Threaded Kernel"
Return
StrCmp $9 "ntoskrnl.exe" "" +3
MessageBox MB_OK "Non Hyper Threaded Kernel"
Return
MessageBox MB_OK "Different Kernel"
SectionEnd

MessageBox MB_OK "Hyper Threaded Kernel"
Please remember that you are not necessarily detecting Hyper-Threading; you are simply searching for the use of the multi-processor NT kernel. A dual-PIII or AthlonMP system will also use this kernel.

Cheers!

Luke

http://or1cedar.intel.com/media/trai...t_v1/tutorial/ contains a code example for detecting hyper-threading. It shouldn't be hard to put that into a plug-in.