Archive: Read registry directory version or name, please help!


Read registry directory version or name, please help!
Greetings!

I new to NSIS world! I finding the answers for two questions:

1) I need to detect the version of certain software from register. But the software version is written as a sub-directory name, not the registry string value. For example, in software registery display as HKLM "SOFTWARE\MyApp\1.5, the 1.5 is the software version. May I know the way to get the version or name from the directory, so that I can make the version comparing task.

2) One more question I always confuse is we can set the JAVA_HOME environment path in the registry in NT OS, can we do the same for WIN 95/ 98. Or for Win 95/98 OS we need to set it into the C:\autoexec.bat file?

I hope some "Guru" will show some useful sample code, thank you!


1) Use EnumRegKey. If there are multiple keys you should check for a certain subkey or value.

2) kichik's link is better :P


1) EnumRegKey should do the trick.
2) Use WriteEnvStr (also have a look here if you are using NSIS latest CVS version). Please search the forum first next time.


Thank you Joost Verburg and kichik, I got it! :up: I did search the forum for answer but maybe I miss see the page, sorry about that! :D