Old 20th June 2016, 08:33   #1
sridiculous
Junior Member
 
Join Date: Jun 2016
Posts: 2
EnumRegKey skipping over certain Keys - Help

I have a requirement where I need to detect all the installed versions of Java. I am writing a simple script to iterate over all the registry keys to detect the versions. The installer seems to be skipping over some keys and not returning the entire registry keys. Here is the piece that I have written:

code:

ReadRegKey:
EnumRegKey $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" $0
MessageBox MB_OK "Registry Key: $1"
IntOp $0 $0 + 1
StrCmp $1 "" ReadRegValue
Goto ReadRegKey
ReadRegValue:



I have the following Keys in the registry for that particular parent key:
1.7, 1.7.0_79, 1.8, 1.8.0_60
When I print the values for the Registry Key above, it only shows the 1.8 & 1.8.0_60 and seems to skip over 1.7 & 1.7.0_79.

Unable to figure out what might be the issue here and need some help from the experts. Tried searching for over 3 days now and couldn't find any relevant information yet.

Note: This is my first NSIS script and so kind of lost.
sridiculous is offline   Reply With Quote
Old 20th June 2016, 11:19   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,873
Are you setting $0 to 0 before the loop?

If yes then the problem is something else. Probably registry virtualization or wow64 redirection...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 20th June 2016, 12:23   #3
sridiculous
Junior Member
 
Join Date: Jun 2016
Posts: 2
Yes, I am setting it to 0 before that. I did check in the registry for the WOW virtualization as well but couldn't find anything.
sridiculous is offline   Reply With Quote
Old 20th June 2016, 14:04   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,873
And what happens if you try to read directly from the keys it failed to enumerate?

Spying on these operations with Process Monitor might also be helpful...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
enumregkey, java, nsis

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