Old 30th June 2008, 04:39   #1
dandaman32
Senior Member
 
dandaman32's Avatar
 
Join Date: Jan 2005
Location: Look behind you.
Posts: 209
Get the number of CPUs or cores in a system

Hey it's me again! *breathes in the Winamp-forumy nostalgia*

So I'll keep it short and sweet. I broke out the ol' WinXP license to work on an installer for a paying client. I need to be able to detect the number of CPUs or cores in a system and can't seem to find out from Google how to do this with NSIS or any of its plugins. Anyone know of a plugin that can do this, or maybe someone with Windows API knowledge could hack something up in ten minutes? Thanks!

--Dan

ExperienceUI for NSIS | Latest project: Enano CMS
Do not PM me on the Winamp forums, I hardly ever check my messages here; you are more likely to get my attention through the ExperienceUI forum.
dandaman32 is offline   Reply With Quote
Old 30th June 2008, 05:35   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
http://nsis.sourceforge.net/CPUDesc_plug-in

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 1st July 2008, 13:05   #3
Mr Inches
Member
 
Join Date: Jan 2006
Location: Canberra, Australia
Posts: 76
You could also use the built-in registry functions to enumerate the keys and values under the following key (Windows only of course):

HKLM\HARDWARE\DESCRIPTION\SYSTEM\CentralProcessor

This is the key that Windows populates during bootup so it reflects the actual number of processors/cores that Windows sees including changes in BOOT.INI/BCD to limit them.

There is one sub-key for each processor (0,1,2,3 etc) and the values are the description of processor characteristics including approximate clock speed and processor brand/model.

Duncan
Mr Inches 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