-Function GetJRE
- ${If} ${RunningX64}
- StrCpy $JavaDownload ${JRE64_URL}
- StrCpy $JavaBits "64"
- ${Else}
- StrCpy $JavaDownload ${JRE32_URL}
- StrCpy $JavaBits "32"
- ${EndIf}
-
- MessageBox MB_OK "This product uses Java ${JRE_VERSION}, \
- $JavaBits bits, it will now \
- be downloaded and installed"
-
- StrCpy $2 "$TEMP\Java Runtime Environment.exe"
- nsisdl::download /TIMEOUT=30000 $JavaDownload $2
- Pop $R0 ;Get the return value
- StrCmp $R0 "success" +3
- MessageBox MB_OK "Download failed: $R0"
- Quit
- ExecWait $2
- Delete $2
+Function openLinkNewWindow
+ Push $3
+ Exch
+ Push $2
+ Exch
+ Push $1
+ Exch
+ Push $0
+ Exch
+
+ ReadRegStr $0 HKCR "http\shell\open\command" ""
+# Get browser path
+ DetailPrint $0
+ StrCpy $2 '"'
+ StrCpy $1 $0 1
+ StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char
+ StrCpy $2 ' '
+ StrCpy $3 1
+ loop:
+ StrCpy $1 $0 1 $3
+ DetailPrint $1
+ StrCmp $1 $2 found
+ StrCmp $1 "" found
+ IntOp $3 $3 + 1
+ Goto loop
+
+ found:
+ StrCpy $1 $0 $3
+ StrCmp $2 " " +2
+ StrCpy $1 '$1"'
+
+ Pop $0
+ Exec '$1 $0'
+ Pop $0
+ Pop $1
+ Pop $2
+ Pop $3