Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Possible to detect Hyper Threading? (http://forums.winamp.com/showthread.php?t=196490)

flyakite 14th October 2004 01:44

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?

flyakite 14th October 2004 03:04

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:

code:
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


Mad Doggie 15th October 2004 02:14

Quote:

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

kichik 15th October 2004 13:28

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.


All times are GMT. The time now is 17:25.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.