Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Read DWORD from reg if exists (http://forums.winamp.com/showthread.php?t=280945)

martijntijn 7th November 2007 09:40

Read DWORD from reg if exists
 
I use the following code to read a value(DWORD) from a key:

code:

;Check for Microsoft Internet Information Services
StrCpy $2 0
StrCpy $3 0
findkey1:
EnumRegKey $1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Oc Manager" $2
StrCmp $1 "Subcomponents" findvalue1
IntOp $2 $2 + 1
StrCmp $1 "" 0 findkey1
goto nokey1
findvalue1:
MessageBox MB_OK "Finding Value $1 + $2 + $3"
ReadRegDWORD $3 HKLM Software\Microsoft\Windows\CurrentVersion\Setup\OC Manager\Subcomponents iis_common
MessageBox MB_OK "Value= $1 + $2 + $3"
StrCmp $3 "" novalue1
StrCmp $3 "" 0 done1
nokey1:
MessageBox MB_OK "NOKEY: $1"
goto finish1
novalue1:
MessageBox MB_OK "NOVALUE: $3"
goto finish1
done1:
MessageBox MB_OK "Internet Information Services is installed"
goto finish1
finish1:



But i always get the NOVALUE Messagebox. What i`m i doing wrong?

Afrow UK 7th November 2007 13:00

Rather than comparing $3 to "", call ClearErrors before ReadRegDWORD followed by IfErrors novalue1.
Make sure you put quotes around the registry path. I bet that script does not even build as you have a space in it.

Stu


All times are GMT. The time now is 04:37.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.