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


How to install jre with background process while instaling through NSIS?
I have try to install jre through in my exe with the following code:

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

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?


1a:
http://nsis.sourceforge.net/ExecCmd_plug-in

1b:
http://docs.oracle.com/javase/7/docs...r-options.html

2:
http://docs.oracle.com/javase/7/docs...r-options.html


Thanks jp.I have tired JRE online document.but it seems to be not working well.
I have tried this command

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


http://stackoverflow.com/questions/1...ry-with-spaces


once again thanks Jp.its very useful link for me.After referred given URL i have tried following command:

ExecWait '$TEMP\jre.exe /s /v"/qn INSTALLDIR=\"$INSTDIR\jre.exe" "'

This time jre installation is not happening.Its goes next step.
Jre installation is not possible in silent mode using NSIS?


Why do you use /qn option?
It's not supported.
Also you have to escape 2 double quotes.
Use

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

OK, you probably don't need to escape the double quotes, but you still have to use them.
So also try

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

Thanks,Finally its worked Using following command for your above reference

http://stackoverflow.com/questions/1...ry-with-spaces

'$TEMP\jre.exe /s /v"/qn INSTALLDIR=\"$INSTDIR\jre6\" " '