No announcement yet.

EnumRegKey skipping over certain Keys - Help

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:


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

    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.

  • #2
    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


    • #3
      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.


      • #4
        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