0

I have try to install jre through in my exe referred this link

Function installjre
SetOutPath '$TEMP'
SetOverwrite on
File lib\jre.exe
Exec $TEMP\jre.exe $0
FunctionEnd

I have used above and Its working very well.

problem:

  1. How to Install jre in background process? Is possible to install jre as silent mode?
  2. by default jre will take c:\program files\java\jre and i need to change this path to $INSTDir\jre while running silent mode

I have tried following command it seems to be does not work

Exec /silent $TEMP\jre.exe $0

How to solve above two problems?

Community
  • 1
  • 1
Ami
  • 4,241
  • 6
  • 41
  • 75

1 Answers1

2

In the online documention for JRE Installer Options one can read:

<jre>.exe [/lang=] [/s] [IEXPLORER=1] [MOZILLA=1] [INSTALLDIR=:\] [STATIC=1]

  1. in the details for the options:

    /s, if used, indicates silent installation

  2. and also

    INSTALLDIR, if used, specifies the drive and path of the installation If INSTALLDIR is not specified, the installation will go into C:\Program Files\java\jre1.6.0 (default location).

Thus the correct invocation for the jre setup would be

ExecWait '"$TEMP\jre.exe" /s INSTALLDIR=$INSTDir\jre'

Notice the ExecWait and quotes usage.

Refer this link Also from escaping quotes.

Community
  • 1
  • 1
Seki
  • 11,135
  • 7
  • 46
  • 70
  • It highly depends on what author meant with "background process". :) I would rather want to know what level ( kind and amount ) of notifications ( popups ; warnings ; etc. ) for user ( the person that will run NSIS isntaller with this feature ) the author wants to have during this "brackground process" .. – HX_unbanned Jun 06 '13 at 12:40
  • Thanks seki.I have tried above command but its not working.Installing jre some window will popup opened,after that there is no installation happening.I dont know what happen? even normal jre installation also not working if i use above command. – Ami Jun 07 '13 at 05:40
  • If i give ExecWait "$TEMP\jre.exe" jre installation done with non-silent mode(GUI-jre installation windows opened). problem is '/s INSTALLDIR=$INSTDir\jre' this command.I dont know what am i did wrong? – Ami Jun 07 '13 at 06:01
  • Do you install path contain spaces characters? You may need to add some quotes like `ExecWait '"$TEMP\jre.exe" /s INSTALLDIR="$INSTDir\jre"'` – Seki Jun 07 '13 at 09:13
  • Thanks.Its working fine.Also i have did some changes followed this link.http://stackoverflow.com/questions/14837697/installing-java-with-silent-install-into-a-directory-with-spaces – Ami Jun 11 '13 at 09:42