Skip to main content

Java 7 update 45 Enterprise deployment

Java 7 update 45 Enterprise deployment

1. Download the latest version of Java from the Windows Offline download page from the following URL http://www.java.com/en/download/manual.jsp
2. From a Administrator command prompt launch the jre-7u45-windows-i586.exe and wait until the initial 'Welcome to Java' screen appears but do NOT press the 'Install' button.

3. At this stage Java will have expanded the installation files to C:\Users\Administrator\AppData\LocalLow\Sun\Java\jre1.7.0_45 > Copy this folder and contents to C:\temp\jre1.7.0_45
There will be two files: jre1.7.0_45.msi and data1.cab
(NOTE: it will be in the LocalLow directory of the user account used to run the command prompt, this example used a local admin account 'Administrator')

4. Use Orca to create an MST file which we can use to transform the MSI for enterprise deployment. Orca is part of the 'Microsoft Windows SDK' can be downloaded here http://www.microsoft.com/en-us/download/details.aspx?id=3138 (useful link here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa370557(v=vs.85).aspx)

4.1 Right click the jre1.7.0_45.msi and select 'Edit with Orca'
4.2 Within Orca Click the 'Transform' dropdown and select 'New Transform'
4.3 At this stage you are not making changing to the original MSI but a Transform file (MST)

5. Select the 'Properties' table on the left and amend the property values as described below on the right
- AUTOUPDATECHECK = 0
- IEXPLORER = 1
- JAVAUPDATE = 0
- JU = 0
- RebootYesNo = No

6. Still within the properties table on the left, click any row on the right.
6.1 Click the Table drop down, and select 'Add Row', using the following Property's and values add the following 4 rows.

Property: REBOOT
Value: R
-------------
Property: SYSTRAY
Value:0
------------
Property: WEB_JAVA
Value: 1
-------------
Property: WEB_JAVA_SECURITY_LEVEL
Value: H
------------

7. Click the 'Transform' dropdown and select 'Generate Transform' and save as 'jre1.7.0_45.mst' in the same directory as the MSI.

8. The original MSI and the newly create MST file can be called with the following syntax
msiexec /i jre1.7.0_45.msi TRANSFORMS=jre1.7.0_45.mst /l*v C:\Windows\Contoso\Logs\Java_7_Update_45.log /qn /norestart

9. When Java is run to upgrade a previous version, the upgrade code detects previous versions and it will be removed prior to deployment.  This process fails when either the /qn switch is used and you reinstall the same version or when Java is currently being used in Internet Explorer.  Both senarios result in a successfull exit code however, the installation has failed and cannot be reinstalled silently, or Loud without a error pop up refering to a missing 'installer.dll.'
9.1 To address both these issues the following two scripts will be of assistance.  One if used at the begining will alway remove the current version before reinstalling.  The second will recover the system to avoid the 'Installer.dll' error.
10. The main feature of the script below to avoid this 'failed state' is the fact that current/previous version is uninstalled
strMSIUni = "msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217045FF} /qn /norestart "
The script below will check to see if IEXPLROER.EXE is running and depending on the whether this is true or not display the SMSNotify.exe wrapper.  If it is not running SMSNotify will not be displayed and the MSI will use only silent switches.

'********************************************************************
'*
'* Author:       syswow64.co.uk
'*
'* Module Name:  sms-notify-Java.vbs
'*
'* Abstract:     Wrapper script for handling non zero exit codes on SMSNotify
'*
'* Exit codes:   0 - Install successful
'*               10 - Install successful (delayed)
'*               NB. All other codes are the MSIEXEC.EXE exit codes
'*
'* Changelog:   18/10/2013 - Java 7 update 45
'*              Check to see if a user is logged on first           
'*
'********************************************************************
On Error Resume Next
Dim oShell, objWMIService
strComputer = "."
'--check to see if IE is running and records it PID
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_Process")
For Each objItem in colItems
    If InStr(objItem.CommandLine, "iexplore.exe") Then
       intProcessID = objItem.ProcessID
    End If
Next
Set colMonitoredProcesses = objWMIService.ExecNotificationQuery _
    ("Select * From __InstanceDeletionEvent Within 1 Where TargetInstance ISA 'Win32_Process'")
'--
Set oShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strComputerName = oShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
strCurrentDir = Replace(WScript.ScriptFullName, WScript.ScriptName, "")
if intProcessID = "" then
 'Wscript.Echo "PId blank."
 RunInstall(True)
 'i = 1
 'wscript.quit
else
iReturn = oShell.Run(Chr(34) & strCurrentDir & "SMSNotify.exe" & Chr(34), 1, false)
  Do Until i = 1
   Set objLatestProcess = colMonitoredProcesses.NextEvent
   If objLatestProcess.TargetInstance.ProcessID = intProcessID Then
    Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'SMSNotify.exe'")
    For Each objProcess in colProcessList
    objProcess.TContosoinate()
    Next 
   i = 1
   End If
  Loop
'Wscript.echo "Loop ended"
RunInstall(false)
End If

Sub RunInstall(blnQuiet)
 strCMD = oShell.ExpandEnvironmentStrings("%COMSPEC%") & " /c "
 strMSI = "msiexec.exe /i " & Chr(34) & strCurrentDir & "jre1.7.0_45.msi" & Chr(34) & " "
 strMSIUni = "msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217045FF} /qn /norestart "
 strTransform = "TRANSFORMS=" & Chr(34) & strCurrentDir & "jre1.7.0_45-ie-sc.Mst" & Chr(34) & " "
 strLogging =  "/lv* " & Chr(34) & "%WINDIR%\Contoso\Logs\jre1.7.0_45.log" & Chr(34) & " "
 strLoggingUni = "/lv* " & Chr(34) & "%WINDIR%\Contoso\Logs\jre1.7.0_40_Uninstall.log" & Chr(34) & " "
 strRestart = "/norestart "
 strCommand = strCMD & strMsi & strTransform & strLogging & strRestart
 'strCommandUni = strCMD & strMsiUni & strLoggingUni & strRestart
intMSIReturn = oShell.Run(strMSIUni, 0 , True)
 If blnQuiet = True Then
'wscript.echo "True"
  intMSIReturn = oShell.Run(strCommand & "/qn", 0, True)
 Else
  intMSIReturn = oShell.Run(strCommand & "/qn+", 0, True)
 End If
 WScript.Quit intMSIReturn
End Sub



<#'********************************************************************
#'*
?# Powershell script
'* Author: syswow64.co.uk
'* Module Name: Test-Path-installer.dll.ps1
'*
'* Abstract: error pop up refering to a missing 'installer.dll.'  installer.dll should be present in the same directory as the ps1 script.
'* SCCM command line: powershell.exe -ExecutionPolicy Bypass -file "./Test-Path-Installer.dll.ps1"
'*
'*
'* Changelog: 18/10/2013 - Test-Path-installer.dll.ps1
'* Check to see if a file and folder exist.  If they dont they will be created/copied.
'*
'********************************************************************#>

$source =  ".\installer.dll"
$destinationfolder = "C:\Program Files\Java\jre7\bin"
$destination = "C:\Program Files\Java\jre7\bin\installer.dll"
$TestPathfile = Test-Path $destination
$TestPathfolder = Test-Path $destinationfolder
IF (!$TestPathfolder) {New-Item $destinationfolder -Type Directory}
IF (!$TestPathfile) {Copy-Item $source $destination -Verbose}


Comments

  1. In your script you only check to see if IE is open... would you add additional checks for Firefox and Chrome? Or can Java install with those browsers open? I was under the assumptions that all browsers must be closed.

    ReplyDelete
    Replies
    1. This is a good question. Add the additional process executables to addition if statements.
      If InStr(objItem.CommandLine, "iexplore.exe") Then
      intProcessID = objItem.ProcessID
      End If
      If InStr(objItem.CommandLine, "firefox.exe") Then
      intProcessID = objItem.ProcessID
      End If

      '(Check the firefox.exe is the the correct process)

      Delete
    2. This is a good question. Add the additional process executables to addition if statements.
      If InStr(objItem.CommandLine, "iexplore.exe") Then
      intProcessID = objItem.ProcessID
      End If
      If InStr(objItem.CommandLine, "firefox.exe") Then
      intProcessID = objItem.ProcessID
      End If

      '(Check the firefox.exe is the the correct process)

      Delete
  2. Hi,

    Nice work, thank you.

    Could you explain in more detail the sitchers REBOOT and SYSTRAY?.

    I know about SYSTRAY for not showing the Java logo when starting, but it seems deprecated by Oracle in Java 7 an earlier versions. How could I hide the logo in the newer versions?

    I can see all the switches but SYSTRAY and REBOOT in the registry after the installation in the hive HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment\1.7.0_45\MSI.

    On the other hand, I think it would be a good option to set all those Java switches with Windows Group Policy Preferences.

    Thank you.

    ReplyDelete
    Replies
    1. I will update the article soon with the details of the switches i.e. REBOOT, SYSTRAY

      Delete
  3. Hi,

    Nice work, thank you.

    Could you explain in more detail the sitchers REBOOT and SYSTRAY?.

    I know about SYSTRAY for not showing the Java logo when starting, but it seems deprecated by Oracle in Java 7 an earlier versions. How could I hide the logo in the newer versions?

    I can see all the switches but SYSTRAY and REBOOT in the registry after the installation in the hive HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment\1.7.0_45\MSI.

    On the other hand, I think it would be a good option to set all those Java switches with Windows Group Policy Preferences.

    Thank you.

    ReplyDelete
  4. Some really good info here! I’m getting ready to deploy 7U40 and have found it behaves very similar to what you are reporting with 7U45
    Is the installer.dll the root cause of the broken installs? I was contemplating making that DLL part of the detection method in SCCM this could help with the false exist code 0

    ReplyDelete
    Replies
    1. Yes, when the Java MSI runs it will check for the existance and content of installer.dll and without it a pop up error is produced before proceeding with either the uninstallation or reinstallation.

      Delete
  5. Some really good info here! I’m getting ready to deploy 7U40 and have found it behaves very similar to what you are reporting with 7U45
    Is the installer.dll the root cause of the broken installs? I was contemplating making that DLL part of the detection method in SCCM this could help with the false exist code 0

    ReplyDelete
  6. hi,
    I am new to vb script and sccm, where can I have the smsnotify.exe and when do you call the pst since the vb script for uninstall is commented out

    I appreciate the

    ReplyDelete
  7. hi,
    I am new to vb script and sccm, where can I have the smsnotify.exe and when do you call the pst since the vb script for uninstall is commented out

    I appreciate the

    ReplyDelete
  8. Nice info, but I cannot find this SMSNotify either, but found some old references to it from 2004...? Is it available for download somewhere? Sorry if this is a stupid question.

    Anyway, thanks for the nice scripts.

    ReplyDelete
  9. Nice info, but I cannot find this SMSNotify either, but found some old references to it from 2004...? Is it available for download somewhere? Sorry if this is a stupid question.

    Anyway, thanks for the nice scripts.

    ReplyDelete

Post a Comment

Popular posts from this blog

SCCM Unknown computer not able to see Task Sequences after installing Current Branch 1702

Soon after installing SCCM CB 1702 we were unable to see Task Sequences deployed to the unknown collection. This issue was identified as a random system taking the GUID of the 'x64 Unknown Computer (x64 Unknown Computer)' record. As a result it was now a known GUID; as we were only deploying Task Sequences to the Unknown collection none were made available. 'x64 Unknown Computer (x64 Unknown Computer)' record 'x86 Unknown Computer (x86 Unknown Computer)' record To get the GUID of your unknown systems open SQL management studio and run the following command: --Sql Command to list the name and GUID for UnknownSystems record data select ItemKey, Name0,SMS_Unique_Identifier0 from UnknownSystem_DISC Using the returned GUID (SMS_Unique_Identifier0) we can find the hostname that has been assigned the 'x64 Unknown Computer (x64 Unknown Computer)' GUID by running the query below. --x64 Unknown Computers select Name0,SMS_Unique_Identifier0,Decommissioned0 from Sys...

Windows 7 Offline files will not go Online when connected to network

Issue Several laptop users move between networks, domain, home, etc and when they attempt to access DFS shares explorer status is working offline.  The issue only resolves it self after a reboot. Connecting directly to the share works and i am able to ping network resources.  This behavior occurs for VPN users as well. Possible Causes "slow-link mode". In win7 (with default settings) a client will enter slow-link mode if the latency to the server is above 80ms. In slow-link mode all writes are made to the local cache and a background sync only happens every 6 hours.  Depending on your connection the default slow link detection speed is 64,000 bps On client computers running Windows 7 or Windows Server 2008 R2, a shared folder automatically transitions to the slow-link mode if the round-trip latency of the network is greater than 80 milliseconds, or as configured by the "Configure slow-link mode" policy. After transitioning a folder to the slow-link mode, Offline Fil...

SCCM Software Update - Job error 0x80004005 Failed to Add Update Source for WUAgent

SCCM Software Updates - Failed to Add Update Source for WUAgent  Today I have been looking at a range of servers (Server 2008 /R2 2012 /R2) that were failing to communicate with the Software Update Point (SUP) in SCCM and retrieve deployment policy. The UpdateDeployment.log was reporting the Job error 0x80004005 Job error (0x80004005) received for assignment ({af7a48e6-d550-4070-dd9b-ecc234567584}) action UpdatesDeploymentAgent 12/6/2017 10:32:27 AM 2096 (0x0830) The WUAHandler.log  was reporting "Unable to read existing WUA Group Policy object" and "Failed to Add Update Source for WUAgent " Unable to read existing WUA Group Policy object. Error = 0x80004005. WUAHandler 12/6/2017 3:41:00 AM 2828 (0x0B0C) Failed to Add Update Source for WUAgent of type (2) and id ({3AAB6A76-CE2D-4E8A-9F11-123AE69612A1}). Error = 0x80004005. WUAHandler 12/6/2017 11:03:31 AM 2276 (0x08E4) Until the agent can report back to the SUP, SCCM will not be able to summarize Software Update sta...