Old 14th October 2004, 01:44   #1
flyakite
Member
 
Join Date: Dec 2003
Location: Chicago
Posts: 50
Send a message via AIM to flyakite Send a message via Yahoo to flyakite
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 is offline   Reply With Quote
Old 14th October 2004, 03:04   #2
flyakite
Member
 
Join Date: Dec 2003
Location: Chicago
Posts: 50
Send a message via AIM to flyakite Send a message via Yahoo to flyakite
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

flyakite is offline   Reply With Quote
Old 15th October 2004, 02:14   #3
Mad Doggie
Junior Member
 
Join Date: Sep 2003
Location: Roswell, GA
Posts: 44
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
Mad Doggie is offline   Reply With Quote
Old 15th October 2004, 13:28   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump