Skip to content
⌘ NSIS Forum Archive

Install a JRE with the NSIS installer

14 posts

Leonard S#

Install a JRE with the NSIS installer

Hello,

i wanna write an installer for Jext.
This java-editor needs a JRE.
I must include the main components of Jext + the latest
JRE.

My Question:
Can NSIS launch the JRE Setup? So, the installer shouldn't only extract the *.exe, it should run the setup of the JRE.

Is this possible?
Thanks 🙂
Sunjammer#
Something like :-
File /oname="$TEMP/jre_setup.exe" jre_setup_exe_filename.exe
ExecWait "$TEMP/jre_setup.exe"
kichik#
If ExecWait doesn't wait see:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Leonard S#edited
After using the code of Sunjammer i was getting an error (screenshot).
It means, that there was an error while overwriting a file (?).

What means "jre_setup_exe_filename.exe"
Which Filename? 😕

Ok, kichik, now i have a look at your link 🙂

btw:
With NSIS i can check if Flash-player is installed, right?
Can i also check if a JRE/JDK is installed?
If not, could i use a checkbox at the end of the installation?
Many installers are using checkboxes for "view the readme now" and so on, can i use a checkbox for installing the JRE?
So, if the user checks the box "install the JRE now", the installtion of the JRE starts. (In modern UI)
kichik#
Try (notice the back slash instead of the forward slash):

File /oname="$TEMP\jre_setup.exe" jre_setup_exe_filename.exe
ExecWait "$TEMP\jre_setup.exe"
There have been some threads about detecting JRE. Search the forum and have a look at The Archive too.
Leonard S#
Thanks, i've found one 😁.

Yes, i know, i've changed the slash to a backslash, but i get still this error.

What about the checkbox method?
kichik#
According to that screen shot you haven't changed both, namely the one in the /oname.

Joost or somebody else will have to answer the checkbox question because I can't quite remember right now (it's 2am here 🙂).
Leonard S#
It doesn't work, and yes, i've changed both slashes.
It seems, that the Installer thinks the "JRE" is extracted to "$INSTDIR\$TEMP\jre_setup.exe", but it must be only "$TEMP\jre_setup".
kichik#
Use (without the quotes in /oname):

File /oname=$TEMP\jre_setup.exe jre_setup_exe_filename.exe
ExecWait "$TEMP\jre_setup.exe"
Sunjammer#
Originally posted by Leonard S What means jre_setup_exe_filename.exe"
Which Filename? 😕
The file name of the program you have to run to perform the JRE installation.
Leonard S#
Thanks very much dudes.
Now it works 🙂
Another Question:
Jext has many files, must i include them all with the "File" command?
Sunjammer#
File /r will recursively add the contents of a directory and wildcards are also supported. See http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.5