简体   繁体   中英

How to install oracle jdk 7 silently in script with dependency?

I am trying script the install for Glassfish on a 64bit windows 2008 r2 server. But in order to install that, I need a JDK. Therefore, I am trying to silently install JDK 7 (u21) prior to glassfish. My problem I'm finding is that when I kick off the install using the following command, the command line immediately returns, so I have no way of knowing from the command line when the install is complete as it appears to run in the background.

REM Copy jdk installer and run silently
copy x:\java\glassfish\windows\jdk-7u21-windows-x64.exe jdk.exe
jdk.exe /s

My next step then immediately kicks off prior to my jdk being installed, which causes the glassfish installer to fail.

copy x:\java\glassfish\windows\glassfish-3.1.2.2-windows.exe glassfish.exe
REM command to silently install GF goes here 

Is there a flag I can pass in to the jdk installer to force it to not run in the background, so that when my script is able to run the next command, I am certain that the JDK is installed?

Or does the very nature of running it silently mean that it will simply run in the background and there's no way around it? And if this is the case, any thoughts on how I could get my script to wait for the jdk to complete prior to continuing?

use START with the WAIT par, ie

START /WAIT jdk.exe /s

Start is an internal command to cmd.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM