Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Get the number of CPUs or cores in a system (http://forums.winamp.com/showthread.php?t=293803)

dandaman32 30th June 2008 04:39

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

Red Wine 30th June 2008 05:35

http://nsis.sourceforge.net/CPUDesc_plug-in

Mr Inches 1st July 2008 13:05

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


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

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.