Old 23rd January 2009, 14:32   #1
dbach
Member
 
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
Howto ReadRegStr (default) Subkeys?

Hi Community.

I have a strange behaviour here:
PHP Code:
Section ReadRegTest
ClearErrors
    ReadRegStr 
$0 HKLM "Software" ""
    
IfErrors Software_No Software_Yes

Software_Yes
:
MessageBox MB_OK "Yes, Software path was found"
Goto Reg1End
        
Software_No
:
MessageBox MB_OK "No, Software path was NOT found"
Goto Reg1End

reg1end
:
SectionEnd

Section ReadRegTestII
ClearErrors
    ReadRegStr 
$0 HKLM "Software\Microsoft" ""
    
IfErrors Microsoft_No Microsoft_Yes

Microsoft_Yes
:
MessageBox MB_OK "Yes, Microsoft path was found"
Goto Reg2End
        
Microsoft_No
:
MessageBox MB_OK "No, Mirosoft path was NOT found"
Goto Reg2End

Reg2End
:
SectionEnd 
Section 1 says "Yes" (HKLM\Software exists)
Section 2 says "No" (HKLM\Software\Microsoft does not exists but it does)

Also, these screenshots seems pretty interessting:






Now I am confused.

All I need is to know if the SubKey is there or not. But how can I do this when there is no "default"?
dbach is offline   Reply With Quote
Old 23rd January 2009, 14:57   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
are you sure it's not just the lack of a backslash in your code?

"SoftwareMicrosoft" -> "Software\Microsoft" ?
Animaether is offline   Reply With Quote
Old 23rd January 2009, 15:02   #3
dbach
Member
 
Join Date: Apr 2006
Location: Somewhere in Germany
Posts: 81
Quote:
Originally posted by Animaether
are you sure it's not just the lack of a backslash in your code?

"SoftwareMicrosoft" -> "Software\Microsoft" ?
No, the "\" was removed on this posting (?). On the screenshot (Line 173/178) you can see that I ask for the (correct) subkey. But there is no value in the "Microsoft" Subkey. :|

Thnx4ur reply.
dbach is offline   Reply With Quote
Old 23rd January 2009, 15:07   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Regedit shows 'Wert nicht gesetzt' (Value not set) for your value which means there isn't one.

Stu
Afrow UK is offline   Reply With Quote
Old 23rd January 2009, 15:18   #5
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
odd (the backslash)

anyway - try with EnumRegKey instead, perhaps?
code:

EnumRegKey $0 HKLM "Software" 0
EnumRegKey $0 HKLM "Software\Microsoft" 0

Animaether 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