How To Install Java 7 Update 11 Using a Script!

This is a script, with multiple tasks, that will install Java 7 Update 11 and remove previous versions

Pre Requisites

K1000
A test machine to push Java
Java 7 Update 11 Installer

 Download it here!

http://www.java.com/en/download/index.jsp


(Note:  On your test machine please have desktop or remote desktop access to it for troubleshooting.)

Configuring The Script

Configuring the script is pretty straight forward.  The most important part will come during the parameters.  Don't worry I have attached screenshots. :)

1.  From the home screen click on "Scripting".

 

2.  Click on "Add New Item".

3.  Choose Online KScript.

(Note:  Look to the right of this screen.  There are alot of helpful tips and explanations.)

4.  Change the Status to Production.

5.  Click the checkbox to enable the script.

(Note:  If this box is not checked the script will not run.)

6.  Choose a test computer before applying this script to a Smart Label.


7.  Choose a supported operating system.


Now comes the tough part.

8.  Add a new dependency.


(Note:  Browse to where the .exe file is located)

9.  Add a task.
    a.  Add a Verify task.
        i.  Verify a directory exists...
        ii.  Directory:  $(KACE_DEPENDENCY_DIR)
(Note:  This is where the Kbox download the dependencies too.)

  b.  Add an On Success task  

       i. Run a Batch File...
      ii. Script Name:Remove Old Versions of Java
      iii. Batch File:

{

@echo off

start /wait MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83217011FF} /qn

start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150000} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150010} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150020} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150030} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150040} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150050} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150060} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150070} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150080} /qn
start /wait msiexec.exe /x {3248F0A8-6813-11D6-A77B-00B0D0150090} /qn

start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216010FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216011FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216012FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216013FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216014FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216015FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216016FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216017FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216018FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216019FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216020FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216021FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216022FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216023FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216024FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216025FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216026FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216027FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216028FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216029FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216030FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216031FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216032FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216033FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216035FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216036FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216037FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83216038FF} /qn

start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217001FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217002FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217003FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217004FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217005FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217006FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217007FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217008FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217009FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217010FF} /qn
start /wait MsiExec.exe /X {26A24AE4-039D-4CA4-87B4-2F83217011FF} /qn

}


      iiii.Parameters:/qn
      iiiii.Save Changes

     

10. Add another Task
     a.  Add a Verify task.
        i.  Verify a directory exists...
        ii.  Directory:  $(KACE_DEPENDENCY_DIR)
(Note:  This is where the Kbox download the dependencies too.)

     b.  Add an On Success task         
       i.  Launch a Program.
      ii.  Directory:  $(KACE_DEPENDENCY_DIR)
     iii.  File:  jre-7u11-windows-i586.exe
    iiii.  Parameters:  /s /v /norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0
   iiiii.  Check "Wait for completion" checkbox.

(Note:  These parameters worked on this program.  Different .EXE, .MSP's, and .MSI's require different parameters and you can find that information from the software manufacturer.  A link to a list of standard Installer Command Line Options can be found at the bottom of the blog.)

Your Policy or Job rules should look something like this!

Dependencies:

Task 1:

(Note:  This batch file removes most ofthe previous versions.  You might have to tailor the batch file to the needs of your environment.  Notice :Wait for completion is checked.")


Task 2:

 

(Note:  This task installs the exe silently turning off autoupdate checks.)


11.  Save the Script.

12.  Now click on the script you just created and run it by clicking on the "Run Now" button.

(Note:  For troubleshooting purposes enabling a custom pre-install message can be fun and let you know when the script is being pushed to the client.)

Did it work?

If so, then create a label that looks for machines in your environment that needs it.

Then add that label to the deployment section.

Congratulations!  You have created your script with a that installs Java 7 Update 11 and removes the previous versions.

Standard Installer Command Line Options

http://msdn.microsoft.com/en-us/library/windows/desktop/aa372024%28v=vs.85%29.aspx

Special Thanks goes out to my customer Mark D.