Ami
Ami

Reputation: 4259

How to install jre with background process while instaling through NSIS?

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?

Upvotes: 0

Views: 1361

Answers (1)

Seki
Seki

Reputation: 11465

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.

Upvotes: 2

Related Questions