CPUDesc plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Put capitalization on file name.)
m (Adding new author and category links.)
Line 1: Line 1:
{|align=right
{{PageAuthor|menakkis}}
|<small>Author: [[{{ns:2}}:menakkis|menakkis]] ([[{{ns:3}}:menakkis|talk]], [[{{ns:-1}}:Contributions/menakkis|contrib]])</small>
 
|}
<br style="clear:both;">
== Links ==
== Links ==
<attach>Cpudesc.zip</attach>
<attach>Cpudesc.zip</attach>
Line 30: Line 28:
See cpudesc.txt for more info.
See cpudesc.txt for more info.


[[{{ns:14}}:Plugins]]
[[Category:Plugins]]

Revision as of 11:53, 24 June 2005

Author: menakkis (talk, contrib)


Links

Cpudesc.zip (12 KB)

Description

It's a plugin with one function: tell(). It returns a string giving some information about the CPU on the computer where your setup program's being run. This info string always has the same fields in exactly the same place, so it's easy to pull it apart. The info string looks like this:

 INTELP=d AMD=add PPRO=b MMX=d SSE=b SSE2=b 3DNOW=d ARCH=dd LEVEL=dd NCPU=dd

"d" means a decimal digit (0..9), "a" means a letter (A..Z), and "b" means a boolean digit (0 or 1).

Usage

(e.g. in your Install section):

; ...
  cpudesc::tell
  Pop $0                     ;full identification string in $0
 
  StrCpy $1 $0 1, 22         ;pull out one character after PPRO=
  IntFmt $2 "%u" $1          ; and turn it into a number
  IntCmpU $2 1 +1 +3 +3      ;pick a BLOG dep on PPro compatibility
  File /oname=blog.exe "blog_source_directory\blog_gen.exe"
  Goto +2
  File /oname=blog.exe "blog_source_directory\blog_pro.exe"
; ... the rest of your Install section

See cpudesc.txt for more info.