Java

From wiki.adammorgan.org
Jump to: navigation, search

General Info

Installs Java 7 update 51. Sets and locks security level to "medium" and enables browser plugins for all users. Tested in Win XP, 7, and 8 (x86/x64).

References

Acquiring .msi and .cab installer files

  • Download the x86 offline installer from https://java.com/en/download/manual.jsp , run the installer, then while it's open find the .msi and .cab, which should be temporarily stored somewhere like:
WinXP: C:\Documents and Settings\amorgan\Application Data\Sun\Java\jre1.7.0_51
Win7: %USERPROFILE%\AppData\LocalLow\Sun\Java
  • While the installer window is still open, copy the .msi and .cab to a new folder in \\leasql\netinstalls\java. Open .msi in Orca, and generate a transform: customize the property table entries for name and version as desired.
  • Newer versions may not have the .cab file.

Note: Both x86 and x64 Windows should receive only the x86 version of Java. Winx64 needs the x32 version for the x32 bit versions of IE and Firefox. Most people don't bother installing x64 java on x64 machines.

Internet Explorer Add-On Management

After installing java for the first time, or updating to a new version, Internet Explorer notices that the Java add-on/plugin is new, and will prompt them (upon loading a site that uses a java applet) to to allow the add-on to run. You can override this with some GPO settings.

  • You must specify each add-on that is allowed, identifying it by its CLSID. Open IE, go to tools, "manage add-ons", then select to show "all add-ons" from the drop down. Find each java-related add-on, right click it, and select "more information". Hit "copy" to send all this info to the clipboard, paste it into notepad, and then copy-out the "Class ID", which should look like this:
{8AD9C840-044E-11D1-B3E9-00805F499D93}

You then need to put that CLSID into the GPO, under: Windows Components\Internet Explorer\Security Features\Add-on Management\Add-On List. Specify a value of "1" for each add-on that you want to automatically be allowed. As long as you don't enable the setting "deny all add-ons unless specifically allowed in the add-on list", other add-ons not explicitly specified by the GPO can also be allowed to run.

Java 8u40 Deployment

8u40

Important Notes on Java8u40 msi bugs

See these guides: [2][3]

  • Your msiexec.exe line must use the "/qn" switch - the "/qb" switch can cause problems unless you do some further hacking to the transform file.
  • The Java8u40 msi doesn't run with the correct permissions unless you set the "NoImpersonate" bit in the transform (Open the table “CustomAction” and select the row “installexe”. Change the value in the field “Type” to 3074 (or Hex 0x0C02)).
  • Installation will fail unless the file "C:\ProgramData\Oracle\Java\java.settings.cfg" is present beforehand (it can be a blank file).

deployment.properties

  • Don't warn if version you're installing is out of date or expired.
deployment.expiration.check.enabled=false
deployment.expiration.decision.suppression=true
  • Specify security level and lock per-user changes (HIGH is the lowest setting for this ver)
deployment.security.level=HIGH
deployment.security.level.locked
  • Enable web applets and java web start
deployment.webjava.enabled=TRUE
deployment.webjava.enabled.locked
  • Mixed code - (act as if user had clicked "don't block" when prompted)
deployment.security.mixcode=HIDE_RUN

java_7u51_install.bat

  • You can optionally remove the "ping" line at the bottom if you'll only be using this as a startup script.
@echo off
::installs java 7 update 51 (x86/x64). TESTED in XP & win7x64, win8 x32 - replaced 7u45, web enabled, medium security locked.
 
CLS
:variables
SET _storeserver=myfileserver
::change these to install subsequent versions
SET _version=7u51
SET _installer=jre1.7.0_51.msi
::set log path
SET p_log=C:\MYORG\general.log
::set variables for x86/x64 reg
SET _osbits=x64
IF %PROCESSOR_ARCHITECTURE%==x86 SET _osbits=x86
::set _progfiles
SET _progfiles=C:\Program Files
::set config file path
SET _javasysconfigpath=%windir%\Sun\Java\Deployment

::log that script started
ECHO %date% %time% %~0 Started >> %p_log%
 
:install_java
ECHO Installing Java %_version% %_osbits%, please wait...
START /WAIT msiexec /i \\%_storeserver%\installers\java\%_version%_%_osbits%\%_installer% TRANSFORMS=\\%_storeserver%\installers\java\%_version%_%_osbits%\%_version%.mst /q
 
:configure_java
::if needed, create java per-system configuration folder
IF NOT EXIST %_javasysconfigpath% md %_javasysconfigpath%
::enable browser plugins by default, set default security level to low
COPY /y \\%_storeserver%\installers\java\%_version%_%_osbits%\deployment.config %_javasysconfigpath%\deployment.config
COPY /y \\%_storeserver%\installers\java\%_version%_%_osbits%\deployment.properties %_javasysconfigpath%\deployment.properties

::disable java auto-updater (is this handled by transform?)
regedit /s \\%_storeserver%\scripts\config\startups_disable.reg
::disable quickstarter
IF EXIST "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister

::delete unnecessary start menu items
SET _startmenu=C:\Documents and Settings\All Users\Start Menu\Programs\Java
IF EXIST "%_startmenu%" (
RD /S /Q "%_startmenu%"
)
SET _startmenu=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Java
IF EXIST "%_startmenu%" (
RD /S /Q "%_startmenu%"
)
 
:java_install_eof
::log that script ended
ECHO %date% %time% %~0 Finished >> %p_log%
ECHO.
ECHO Installation Finished! This window will automatically close in 5 seconds...
ping 127.0.0.1>NUL

Uninstall Lines

  • Here are uninstall lines for some misc. versions, if needed.

Uninstall Lines

  • Java 2 Runtime Environment Standard Edition v1.3.1_02
IF EXIST "C:\Program Files\JavaSoft\JRE\1.3.1_02" C:\WINDOWS\IsUninst.exe -a -f"C:\Program Files\JavaSoft\JRE\1.3.1_02\Uninst.isu"
  • Java 2 Runtime Environment, SE v1.4.2
MsiExec.exe /X{7148F0A8-6813-11D6-A77B-00B0D0142000} /qn
  • Java 2 Runtime Environment, SE v1.4.2_03
MsiExec.exe /X{7148F0A8-6813-11D6-A77B-00B0D0142030} /qn
  • Java 2 Runtime Environment, SE v1.4.2_06
MsiExec.exe /X{7148F0A8-6813-11D6-A77B-00B0D0142060} /qn
  • J2SE Runtime Environment 5.0 Update 2 (key from win2k)
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0150020} /qn
  • J2SE Runtime Environment 5.0 Update 4
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0150040} /qn
  • J2SE Runtime Environment 5.0 Update 6
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0150060} /qn
  • J2SE Runtime Environment 5.0 Update 8
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0150080} /qn
  • J2SE Runtime Environment 5.0 Update 9 (key from win2k)
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0150090} /qn
  • J2SE Runtime Environment 5.0 Update 10 (key from win2k)
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0150100} /qn
  • J2SE Runtime Environment 5.0 Update 11
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0150110} /qn
  • Java(TM) SE Runtime Environment 6 Update 1
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0160010} /qn
  • Java(TM) 6 Update 3
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0160030} /qn
  • Java(TM) 6 Update 5
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0160050} /qn
  • Java(TM) 6 Update 7
MsiExec.exe /X{3248F0A8-6813-11D6-A77B-00B0D0160070} /qn