Archive: Using ReadRegStr to read windows service pack version and using <> = but not working.


Using ReadRegStr to read windows service pack version and using <> = but not working.
I am using ReadRegStr to read.

HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CSDversion

CSD Version outputs "SERVICE PACK (NUMBER)"

could I possibly JUST read the number by using some kinda of "read certian charecter of regstr"

What I ultimatly want to do it write a .oninit string to only let the person install if they are using windows 2000 service pack 3 or greater. Here is what I have so far.


Name "Windows Information"
OutFile "wincheck.exe"

Function "getwininfo"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CSDversion
FunctionEnd

section whoa
call "getwininfo"
IntCmp $0 5.0 equal greater abort
equal:
goto continue
greater:
goto continue
abort:
MessageBox MB_OK "You must have Windows 2000 Service pack 3 or greater"
Quit

continue:
MessageBox MB_OK "Yay you have $0 w00t! continue."
SectionEnd


section whoa2
call "getwininfo"
IntCmp $1 [see this is where i'm stuck at.. what to compare] equal greater abort
equal:
goto continue
greater:
goto continue
abort:
MessageBox MB_OK "You must have Windows 2000 Service pack 3 or greater You have $0 $1"
Quit

continue:
MessageBox MB_OK "You have $1 w00t! continue."
SectionEnd


i am totally stuck.

got it! We used strcpy to offset the number of charecters until I got the the one to be compared.