|
|
|
|
#1 |
|
Senior Member
Join Date: Aug 2007
Posts: 117
|
CPUID in NSIS?
Is there a way to get the CPUID information from the assembly instruction in NSIS? Would this need to be done via plugin?
|
|
|
|
|
|
#2 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
You can try calling __cpuid() with the system plugin, if that doesn't work then writing a plugin that calls it will work.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Nov 2012
Posts: 166
|
parasoul
Quote:
code: |
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
The only way to call CPUID directly with the system plug-in is to VirtualAlloc some memory and fill it with the machine instructions before calling it but that is probably overkill. Windows has some CPU information functions you might be able to use if you just tell us why you need to call CPUID...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Aug 2007
Posts: 117
|
I need to call CPUID because I need to see if the hyperthreading and some other features are supported on the user's computer, so I can decide what version of software to run.
__cpuid() i don't believe is an exported function, but an intrinsic function from the compiler, so I don't think that will work Do you know of any exported winapi functions that would perform the same action as __cpuid()? |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Do you actually care about hyperthreading or just single threaded vs multithreaded? Some older CPUs are hyper threaded but single core and the new low-end Intel chips are multi-core but not hyper threaded. GetLogicalProcessorInformation can detect HT on Vista+ but GetActiveProcessorCount or GetProcessAffinityMask might be better if you need to know how many threads to use.
You might be able to call IsProcessorFeaturePresent to detect other features. IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
If you absolutely want to call CPUID yourself:
PHP Code:
IntOp $PostCount $PostCount + 1 |
|
|
|
![]() |
|
|||||||
| Tags |
| cpuid, system plug-in |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|