Old 1st October 2004, 08:33   #1
trizzi_it
Junior Member
 
Join Date: Oct 2004
Posts: 5
Question ReadRegStr in loop

hi all,
my question is simple. is it possible (and how) reading the registry in a loop...

The needed is simple. Suppose that you want to see all the jdk installed in a system.

Normally windows use this registry entry:
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit

and under this key it put several key entries, depending from what you have installed:

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.4

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development
Kit\1.4.2_04

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.4.2_05

so suppose that my application doesn't suppor jdk minor version 04 and support only 05 or highter. I'd like to let the user download the right jdk only if it's not istalled (see present) in the system.
If someone istall 05 and after 04 the current version points to 04 but 05 is installed in the system, in this case i'd like to prevent a jdk download and point my class path and whatever where the right jdk is installed.

thanks a lot
trizzi_it is offline   Reply With Quote
Old 1st October 2004, 09:28   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can use this macro to check if a key exists:
http://nsis.sourceforge.net/archive/...b.php?page=364

-Stu
Afrow UK is offline   Reply With Quote
Old 1st October 2004, 10:03   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You can also use EnumRegKey, EnumRegValue and some integer comparisons for a more general solution.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 5th October 2004, 06:29   #4
trizzi_it
Junior Member
 
Join Date: Oct 2004
Posts: 5
thanks a lot.
I used the second solution + a script for version cheking (well i was able to add a couple of features for java).
trizzi_it 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