;--------- CONFIGURATION --------- ;!define APPNAME "Pedagogica" ;!define JARFILE "workspace.jar" ;Uncomment the next line to specify an icon for the EXE. ;Icon "sunflower-grad.ico" ;Uncomment the next line to specify a splash screen bitmap. ;!define SPLASH_IMAGE "cd-load-screen" ;--------------------------------- Name "PedagogicaLauncher" Caption "CD Java Laucher" OutFile "CDJavaLauncher.exe" SilentInstall silent XPStyle on !addplugindir . var SPLASH_TIME Section "" System::Call "kernel32::CreateMutexA(i 0, i 0, t 'jelude') i .r1 ?e" Pop $R0 StrCmp $R0 0 +2 Quit StrCpy $SPLASH_TIME 4000 ClearErrors ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$R0" "JavaHome" IfErrors 0 FoundVM ClearErrors ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion" ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$R0" "JavaHome" IfErrors 0 FoundVM ClearErrors ReadEnvStr $R0 "JAVA_HOME" IfErrors 0 FoundVM ClearErrors StrCpy $R0 "\jre" MessageBox MB_ICONINFORMATION|MB_OK \ 'It appears Java is not installed on your machine. \ $\nThis program will run faster if you install Java.' StrCpy $SPLASH_TIME 60000 FoundVM: StrCpy $R0 "$R0\bin\javaw.exe" IfFileExists $R0 0 NotFound StrCpy $R1 "" Call GetParameters Pop $R1 SetOutPath $EXEDIR StrCpy $R0 '$R0 $R1' Exec "$R0" !ifdef SPLASH_IMAGE Splash::show 4000 "\autorun\${SPLASH_IMAGE}" !endif Sleep 5000 Quit NotFound: Sleep 800 MessageBox MB_ICONEXCLAMATION|MB_YESNO \ 'Could not find a Java Runtime Environment installed on your computer. \ $\nWithout it you cannot run this application. \ $\n$\nWould you like to visit the Java website to download it?' \ IDNO +2 ExecShell open "http://java.sun.com/getjava" Quit SectionEnd Function GetParameters Push $R0 Push $R1 Push $R2 StrCpy $R0 $CMDLINE 1 StrCpy $R1 '"' StrCpy $R2 1 StrCmp $R0 '"' loop StrCpy $R1 ' ' loop: StrCpy $R0 $CMDLINE 1 $R2 StrCmp $R0 $R1 loop2 StrCmp $R0 "" loop2 IntOp $R2 $R2 + 1 Goto loop loop2: IntOp $R2 $R2 + 1 StrCpy $R0 $CMDLINE 1 $R2 StrCmp $R0 " " loop2 StrCpy $R0 $CMDLINE "" $R2 Pop $R2 Pop $R1 Exch $R0 FunctionEnd