i'm using cpu features plug-in cpu core , code:
${cpufeatures.getcount} $cpucore
apparently, there computer 12 cpu cores , $cpucore shows 1 core. think maybe there possibility $cpucore return first digit, how can know sure?
or, there other way cpu core numbers?
i don't know why plugin failing ask windows this:
!include logiclib.nsh !ifndef error_insufficient_buffer !define error_insufficient_buffer 122 !endif !define relationprocessorcore 0 !if "${nsis_ptr_size}" <= 4 function getprocessorphyscorecount system::store s strcpy $9 0 ; 0 if fail system::call 'kernel32::getlogicalprocessorinformationex(i${relationprocessorcore},i,*i0r2)i.r0?e' pop $3 ${if} $3 = ${error_insufficient_buffer} ${andif} $2 <> 0 system::alloc $2 system::call 'kernel32::getlogicalprocessorinformationex(i${relationprocessorcore},isr1,*ir2r2)i.r0' push $1 ${if} $0 <> 0 loop_7: intop $9 $9 + 1 system::call *$1(i,i.r3) intop $1 $1 + $3 intop $2 $2 - $3 intcmp $2 0 "" loop_7 loop_7 ${endif} pop $1 system::free $1 ${else} system::call 'kernel32::getlogicalprocessorinformation(i,*i0r2)i.r0?e' pop $3 ${if} $3 = ${error_insufficient_buffer} system::alloc $2 system::call 'kernel32::getlogicalprocessorinformation(isr1,*ir2r2)i.r0' push $1 ${if} $0 <> 0 loop_v: system::call *$1(i,i.r3) ${if} $3 = ${relationprocessorcore} intop $9 $9 + 1 ${endif} intop $1 $1 + 24 intop $2 $2 - 24 intcmp $2 0 "" loop_v loop_v ${endif} pop $1 system::free $1 ${endif} ${endif} push $9 system::store l functionend function countsetbits32 exch $0 push $1 push $2 push $3 strcpy $3 0 strcpy $1 0 loop: intop $2 1 << $1 intop $2 $2 & $0 ${ifthen} $2 <> 0 ${|} intop $3 $3 + 1 ${|} intop $1 $1 + 1 strcmp $1 32 "" loop strcpy $0 $3 pop $3 pop $2 pop $1 exch $0 functionend function getprocessorlogicalcorecount system::store s strcpy $9 0 ; 0 if fail system::call 'kernel32::getlogicalprocessorinformationex(i${relationprocessorcore},i,*i0r2)i.r0?e' pop $3 ${if} $3 = ${error_insufficient_buffer} ${andif} $2 <> 0 system::alloc $2 system::call 'kernel32::getlogicalprocessorinformationex(i${relationprocessorcore},isr1,*ir2r2)i.r0' push $1 ${if} $0 <> 0 loop_7: system::call *$1(i,i.r3,&i22,&i2,i.r5) push $5 call countsetbits32 pop $5 intop $9 $9 + $5 intop $1 $1 + $3 intop $2 $2 - $3 intcmp $2 0 "" loop_7 loop_7 ${endif} pop $1 system::free $1 ${else} system::call 'kernel32::getlogicalprocessorinformation(i,*i0r2)i.r0?e' pop $3 ${if} $3 = ${error_insufficient_buffer} system::alloc $2 system::call 'kernel32::getlogicalprocessorinformation(isr1,*ir2r2)i.r0' push $1 ${if} $0 <> 0 loop_v: system::call *$1(i,i.r3) ${if} $3 = ${relationprocessorcore} system::call *$1(i.r3) push $3 call countsetbits32 pop $3 intop $9 $9 + $3 ${endif} intop $1 $1 + 24 intop $2 $2 - 24 intcmp $2 0 "" loop_v loop_v ${endif} pop $1 system::free $1 ${endif} ${endif} push $9 system::store l functionend !endif section call getprocessorphyscorecount pop $0 call getprocessorlogicalcorecount pop $1 detailprint physcores=$0,logicalcores=$1 sectionend
you should still use ${cpufeatures.getcount} fallback because getlogicalprocessorinformation[ex] not exist on versions of windows...