Skip to content
⌘ NSIS Forum Archive

Get ProcessorId

6 posts

r2du-soft#

Get ProcessorId

hi
how can find Processor Id in nsis?
in cmd can find that with code:

wmic cpu get ProcessorId
thanks
r2du-soft#
yes mr Anders,i searching before tried and see wmi in nsis,but not found information about processID
stass#
r2du-soft

;http://nsis.sourceforge.net/WMI_header
OutFile ProcessorId.exe
!include WMI.nsh
Section
${WMIGetInfo} root\CIMV2 Win32_Processor ProcessorId callback_Function
SectionEnd
Function callback_Function
MessageBox MB_OK "ProcessorId: $2"
FunctionEnd 
OR

nsexec::exectostack "wmic /NAMESPACE:\\root\CIMV2 path Win32_Processor get ProcessorId"
 pop $0
 pop $1
detailprint "$1" 
r2du-soft#
thanks mr stass
just one question: this code work in all process? amd and intel? all series?
LoRd_MuldeR#
MSDN info on "ProcessorId" is as follows:
Represents a device that can interpret a sequence of instructions on a computer running on a Windows operating system.


ProcessorId
Data type: string
Access type: Read-only

Processor information that describes the processor features. For an x86 class CPU, the field format depends on the processor support of the CPUID instruction. If the instruction is supported, the property contains 2 (two) DWORD formatted values. The first is an offset of 08h-0Bh, which is the EAX value that a CPUID instruction returns with input EAX set to 1. The second is an offset of 0Ch-0Fh, which is the EDX value that the instruction returns. Only the first two bytes of the property are significant and contain the contents of the DX register at CPU reset—all others are set to 0 (zero), and the contents are in DWORD format.
So, for x86 processors, this is actually the info returned by the CPUID instruction - or actually only a subset of what can be done with the CPUID instruction - indicating the processor's capabilities (MMX, SSE, AVX, etc). It's not a unique per processor "serial number".

I think any AMD/Intel processor from the last two decades supports CPUID, though more flags have been added over the time...

See also here, for example:


If you just want to detect the CPU capabilities, it's probably much simpler to just use: