Jump to content

Recommended Posts

Posted (edited)

I have written a VBScript to perform a silent installation of the Sun Java Runtime. Given that I've borrowed SO much from these forums, I figured I should register and give something back.

This script installs Java to C:\Program Files\Java. It disables the Java auto-update, disables the creation of the "Java Web Start" shortcut and integrates with Internet Explorer and Firefox.

Assumption : You have this version of the JRE and the Microsoft VM uninstaller. You can google unmsjvm.exe and get a copy.

Option Explicit

Dim oShell, oExec, sCmd, iButton, sProgs

Set oShell = WScript.CreateObject("WScript.Shell")

sProgs = oShell.ExpandEnvironmentStrings("%ProgramFiles%")

iButton = oShell.Popup("Removing Microsoft Java VM",3,"Java Update Tool",0 + 64)

sCmd = "unmsjvm.exe /q"

Set oExec = oShell.Exec(sCmd)

Do While oExec.Status = 0
WScript.Sleep 100
Loop

iButton = oShell.Popup("Microsoft Java VM Removed. Now Installing Sun Java VM",3,"Java Update Tool",0 + 64)

sCmd = "jre-1_5_0_10-windows-i586-p-s.exe /s ADDLOCAL=jrecore IEXPLORER=1 MOZILLA=1 INSTALLDIR=C:\Progra~1\Java REBOOT=Suppress JAVAUPDATE=0 WEBSTARTICON=0"

Set oExec = oShell.Exec(sCmd)

Do While oExec.Status = 0
WScript.Sleep 100
Loop

iButton = oShell.Popup("Sun Java Runtime Installation Complete.",5,"Java Update Tool",0 + 64)

Enjoy!

Kevin

Edited by kevin_s

Posted

you can also use thie switches to install it silently

setup.exe /s /v/qb /norestart it works for the latest version. you can also export reg entries to save your settings..

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...