Old 19th May 2003, 19:57   #1
Psychedelic
Junior Member
 
Join Date: May 2003
Posts: 4
Processor, Memory, OS, Graphics Info?

Hi,
I am trying to create an installer that checks to see if the current hardware meets minimum system requirements.
In order to do this I need to check the speed of the processor, total physical RAM, operating system version and also preferably info about the graphics card such as graphics memory.

I have searched the forums and the documentation but i haven't found a function that will give me this information.

Does anyone have any idea how i might accomplish this?

Thanks
Psych
Psychedelic is offline   Reply With Quote
Old 19th May 2003, 21:02   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
You have plugin call "system.dll" in ${NSISDIR}\Plugins".
Check this web archive to see more examples.


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 19th May 2003, 21:59   #3
Psychedelic
Junior Member
 
Join Date: May 2003
Posts: 4
Ok so I looked at the examples at the link you showed me. I'm a beginer as far as programming in win32 is concerned so is there somewhere i can look to find the relevant functions that i need to call?
I need to know the:
Processor Type: (AMD/INTEL)
Process Speed: MHz
RAM: MB
OS: NT/98/ME/2000/XP

and preferably
Video Memory: MB

Thanks
Psychedelic is offline   Reply With Quote
Old 19th May 2003, 22:10   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can get the full Windows version - look here
No-one has written a plug-in to determin how much video card memory a pc has, but somone is currently writing one - look at this post here
As far as I can see, the plugin is really only 5% done!

I'm not sure how to get the processor, mhz, and ram, but I'm sure Kichik could write you something which uses the system plugin.

There is a way to detext the version of Directx nstalled, and to update it in this topic: here

Hope some of them help!

-Stu
Afrow UK is offline   Reply With Quote
Old 19th May 2003, 22:11   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You could also search for a windows specific value in the registry, incase you find where windows may put some useful values.

-Stu
Afrow UK is offline   Reply With Quote
Old 19th May 2003, 22:51   #6
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
Check out the cpudesc plugin here, that can get you the cpu information you require.
Sunjammer is offline   Reply With Quote
Old 21st May 2003, 22:17   #7
Psychedelic
Junior Member
 
Join Date: May 2003
Posts: 4
Ok so I have the OS and the RAM now. I noticed a script that would read an entry of the registy but only of type REG_MULTI_SZ. The system MHz is of type REG_DWORD.
I've tried to modify the file but with no success. Does anyone know how i might acccess this information?

Thanks

The file that I was trying to work off of is located in the plugin's folder in the System Plugins Examples.
Psychedelic is offline   Reply With Quote
Old 22nd May 2003, 16:39   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You don't need a special script to read from REG_DWORD, just use ReadRegDWORD. Make sure that value is always true, on Windows 98 too. I think I have heard about this value somewhere and if I remember correctly it doesn't hold the right value on Windows 98 and is off by a little on other systems.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 22nd May 2003, 17:32   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
To find out the CPU speed you can use a variant of this program:
http://www.codeproject.com/system/cp...asp#xx372884xx

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 22nd May 2003, 17:58   #10
Psychedelic
Junior Member
 
Join Date: May 2003
Posts: 4
Thanks!
That worked.
All i needed was:
ReadRegDWORD $0 HKLM "HARDWARE\DESCRIPTION\System\CentralProcessor\0\" "~MHz"
MessageBox MB_OK "Processor Speed: $0MHz"

I've tested it on NT4, 2000 & XP so far and it works.
Psychedelic is offline   Reply With Quote
Old 22nd May 2003, 18:05   #11
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I have just checked it on Windows 98 and it doesn't work. The key isn't there.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 30th May 2003, 19:51   #12
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Latest CPUDesc gets CPU speed too:
http://nsis.sourceforge.net/archive/...instances=0,32

The page hasn't updated yet but the download has.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th August 2006, 10:39   #13
l_d_allan
Member
 
l_d_allan's Avatar
 
Join Date: Jun 2005
Location: Colorado Springs, CO
Posts: 94
I was trying out this plugin to get the cpu speed. It is a modification of the Examples\System\System.nsi code

With an AMD64-3700 (single CPU) with 2.4 clock speed, I'm getting a mhz result of 1283. The results from the NCPU and RAM are correct. Am I doing something wrong? (Note that I have the cpu running at full-speed, without the energy saving AMD Cool'n'Quiet in effect.)

PHP Code:
This is just an example of cpudesc Plugin
To have this workcpudesc.dll should be in 'plugin' subdirectory
; As of 2006-Aug-27here is a link to cpudesc:
; [
url]http://nsis.sourceforge.net/mediawiki/images/8/87/Cpudesc.zip[/url]

; (
cl_d_allan (modified from system.nsi by brainsucker)

Name "CheckMhz Plugin Example"
OutFile "CheckMhz.exe"
SetPluginUnload  alwaysoff

Section 
"ThisNameIsIgnoredSoWhyBother?"
  
SetOutPath $TEMP

  
; ----- Sample 3a ----- Direct proc definition -----
  ;
0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999
  
;01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
  
;INTELP=d AMD=add PPRO=b MMX=d SSE=b SSE2=b 3DNOW=d ARCH=dd LEVEL=dd NCPU=dd MHZ=ddddd RAM=dddd

  
Direct specification demo
  cpudesc
::tell
  Pop 
$0
 
  StrCpy 
$$0 273         ;pull out two characters after NCPU=
  
IntFmt $"%u" $1          ; and turn it into a number in $4
  StrCpy 
$$0 580         ;pull out five characters after MHZ=
  
IntFmt $"%u" $1          ; and turn it into a number in $2
  StrCpy 
$$0 490         ;pull out four characters after RAM=
  
IntFmt $"%u" $1          ; and turn it into a number in $3
  MessageBox MB_OKCANCEL 
"NCPU: '$4'  Mhz: '$2'  Ram (megs): '$3'"

  
last plugin call must not have /NOUNLOAD so NSIS will be able to delete the temporary DLL
  SetPluginUnload manual
  
; do nothing
  System
::Free 0

SectionEnd 
l_d_allan is offline   Reply With Quote
Old 28th August 2006, 12:03   #14
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The leading zeros cause NSIS to think it's an octal number. You can add another leading number and later remove it.
code:
StrCpy $1 $0 5 80
IntOp $2 1$1 - 100000


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th August 2006, 12:47   #15
l_d_allan
Member
 
l_d_allan's Avatar
 
Join Date: Jun 2005
Location: Colorado Springs, CO
Posts: 94
Thanks ... you're good!

Like so?
PHP Code:
  cpudesc::tell
  Pop 
$0
 
  StrCpy 
$$0 273         ;pull out two characters
                             
; (that may have leading
                             
zeroafter NCPU=
  
StrCpy $1 1$1              ;$1 now has leading 1 in
                             
front of 0 to keep from 
                             
being octal
  IntOp  
$$100         ;remove leading one
  
  StrCpy 
$$0 580         ;pull out five characters 
                             
that may have leading 0
                             
after MHZ=
  
StrCpy $1 1$1              ;$1 now has leading 1 in
                             
front of 0 to keep from
                             
being octal
  IntOp  
$$100000      ;remove leading one

  StrCpy 
$$0 490         ;pull out four characters 
                             
after RAM=
  
StrCpy $1 1$1              ;$1 now has leading 1 in 
                             
front of 0 to keep from 
                             
being octal
  IntOp  
$$10000       ;remove leading one

  MessageBox MB_OKCANCEL 
"NCPU: '$2'  Mhz: '$3'  Ram (megs): '$4'" 
Perhaps it would be appropriate to modify the cpudesc.c code. I took a look at it, and there is this line:

wsprintf( ostr, "INTELP=%1d AMD=%c%2.2d PPRO=%1d MMX=%1d SSE=%1d SSE2=%1d 3DNOW=%1d ARCH=%2.2d LEVEL=%2.2d NCPU=%2.2d MHZ=%5.5d RAM=%4.4d",
intelpentium, amdlet, amd, pprocompat, hasmmx, hassse, hassse2, has3dnow, arch, level, ncpu, mhz, ram );

I'm not familiar with the %5.5d format, but perhaps it should be %5d to maintain spacing. The existing code seems to be equivalent to %05d to put a leading zero (or maybe cpudesc.dll is "out of sync" with cpudesc.c?)

But that might mess up StrCpy $1 $0 5, 80?

I suppose the same "padding" with leading 1 applies to NCPU and RAM ... if you had less than 1 gig of memory?
l_d_allan is offline   Reply With Quote
Old 28th August 2006, 13:11   #16
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Using %-5d in the plug-in should do the trick as the padding will go on the right. But changing that would break backwards compatibility with scripts using StrCmp.

The same padding applies to RAM, but doesn't bother NCPU because it's only two digits.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump