[jsword-devel] Windows installer

Zhaojun Li(李召军) lzj369 at gmail.com
Fri Jan 19 13:53:43 MST 2007


Never mind. I find out.

Here is the script just in case someone else is interested.

Simple Java Runtime Download Script 	   	
From NSIS Wiki 	     	    	    	     	
 Author: mooxie (talk, contrib)



[edit]
 Description

This is a simple code snippet for downloading a JRE.
[edit]
 The Snippet

This at the top:  !define JRE_VERSION "1.5"
!define JRE_URL "http://dlc.sun.com/jdk/jre-1_5_0_01-windows-i586-p.exe"


In your MainSection:  Call DetectJRE


And this wherever you want:  Function GetJRE
        MessageBox MB_OK "${PRODUCT_NAME} uses Java 1.5, it will now \
                         be downloaded and installed"

        StrCpy $2 "$TEMP\Java Runtime Environment.exe"
        nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2
        Pop $R0 ;Get the return value
                StrCmp $R0 "success" +3
                MessageBox MB_OK "Download failed: $R0"
                Quit
        ExecWait $2
        Delete $2
FunctionEnd


Function DetectJRE
  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \
             "CurrentVersion"
  StrCmp $2 ${JRE_VERSION} done

  Call GetJRE

  done:
FunctionEnd


On 1/17/07, Zhaojun Li(李召军) <lzj369 at gmail.com> wrote:
> HI,
>
> I wonder how to build the windows installer? I notice the jsword installer can detect JRE and dowload one from sun if necessary.
> Can anyone share this information?
>
> Thanks!
>
> Zhaojun
>


More information about the jsword-devel mailing list