Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   How Install JDK if not Exist (http://forums.winamp.com/showthread.php?t=225971)

andy susanto 14th September 2005 09:33

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 13:19

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 15:24

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 15:26

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 10:05

Thanks for you explain. i am enlight now


All times are GMT. The time now is 04:26.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.