Detecting the JDK version: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Wikipedia python library)
 
m (Updated author and download links, and changed format of some pages.)
Line 15: Line 15:
</highlight-nsis>
</highlight-nsis>


Page author: pcristip
Page author: [[User:pcristip|pcristip]]

Revision as of 12:34, 23 April 2005

Description

The following code snippet detects whether Java Development Kit is installed on the machine and will set $1 to the version and $2 to the directory of the installation.

The Snippet

ClearErrors
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$1" "JavaHome"
 
IfErrors 0 NoAbort
    MessageBox MB_OK "Couldn't find a Java Development Kit installed. Setup will exit now." 
    Quit        
 
NoAbort:
    DetailPrint "Found JDK in path $2"

Page author: pcristip