title: How to install oracle jdk 7 silently in script with dependency?
body: <p>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.</p>
  
  <pre><code>REM Copy jdk installer and run silently
  copy x:\java\glassfish\windows\jdk-7u21-windows-x64.exe jdk.exe
  jdk.exe /s
  </code></pre>
  
  <p>My next step then immediately kicks off prior to my jdk being installed, which causes the glassfish installer to fail. </p>
  
  <pre><code>copy x:\java\glassfish\windows\glassfish-3.1.2.2-windows.exe glassfish.exe
  REM command to silently install GF goes here 
  </code></pre>
  
  <p>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? </p>
  
  <p>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?</p>