Replace Goto by LogicLib
Hi,
I would like to replace any Goto in my script by LogicLib macros.
There is one last label I can't remove because it is called by a MessageBox. Can you help me to find a way to get rid of this label:
Here is my code. This function detects if JAVA is installed on the computer. I would like to get rid of the label 'EndInit':
Function .onInit
ClearErrors
;Checking if JDK is installed
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$1" "JavaHome"
StrCpy $1 "Java SDK"
${If} ${Errors}
ClearErrors
;JDK has not been found. Checking JRE
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "JavaHome"
StrCpy $1 "Java Runtime"
${If} ${Errors}
MessageBox MB_YESNO "Java has not been found.$\r$\nContinue anyway?" IDYES EndInit
Quit
${EndIf}
${EndIf}
DetailPrint "$1 has been found: $2"
Push "JAVA_HOME"
Push "$2"
Call WriteEnvStr
EndInit:
FunctionEnd