andy susanto
14th September 2005 10:33 UTC
How Install JDK if not Exist
Hai,
i am newbies in NSIS Installer,
I would like to check a JDK. If JDK not exist => install it.
And if JDK exist do not install it.
How to make that happen. Because in my test code always install it i try to check Registry and use "IfErrors" function but i cannot do it
This is my test code :
Section "JDK"
ClearErrors
ReadRegStr $0 HKLM "Software\JavaSoft\Java Development Kit\1.4.2_06" JavaHome
IfErrors Install_JDK
Install_JDK:
ExecWait ${Installer_JDK} ; run if never have a JDK
SectionEnd
Afrow UK
14th September 2005 14:19 UTC
You need to jump over it if it's not installed:
Section "JDK"
ClearErrors
ReadRegStr $0 HKLM "Software\JavaSoft\Java Development Kit\1.4.2_06" JavaHome
IfErrors 0 +2
ExecWait ${Installer_JDK} ; run if never have a JDK
SectionEnd
-Stu
andy susanto
14th September 2005 16:24 UTC
Thanks,
now my installer run like i want :)
Btw what the meaning ifErrors 0 +2. I look on helpfile still i
can not clear about that. Can you explain to me ?
Andy
Afrow UK
14th September 2005 16:26 UTC
IfErrors jumpto_iferror [jumpto_ifnoerror]
IfErrors 0 +2
0 means carry onto the next instruction (same as +1)
+2 means jump over the next instruction onto the one after it
These are relative jumps as opposed to a label jump which you used.
-Stu
andy susanto
16th September 2005 11:05 UTC
Thanks for you explain. i am enlight now