Worklet - Java 271

  • 4 November 2020
  • 5 replies
  • 141 views

Userlevel 3

Hey guys, just need some assistance finalising the Java worklet. The automatic patching seems to have uninstalled Java from a fair few machines so need to resolve.


It works fine running from the local machine, however no luck from Automox.


Eval is fine.

It downloads the two files then does not run the commands; installing 2 instances of Java (32 and 64bit).


#Handle Exit Codes:
trap { $host.ui.WriteErrorLine($_.Exception); exit 90 }

try{

$process1 = Start-Process -FilePath 'jre-8u271-windows-i586.exe' -ArgumentList '/s', 'REMOVEOUTOFDATEJRES=1', '/L C:\ProgramData\amagent\worklets\java\java_86.log' -Wait -Passthru -ErrorAction Stop
$process2 = Start-Process -FilePath 'jre-8u271-windows-x64.exe' -ArgumentList '/s', '/L C:\ProgramData\amagent\worklets\java\java_64.log' -Wait -Passthru -ErrorAction Stop
exit 0

}

Catch{

$Exception = $error[0].Exception.Message + "`nAt Line " + $error[0].InvocationInfo.ScriptLineNumber
Write-Output $Exception
exit 90
}

Would appreciate any assistance.


5 replies

Hey there. I haven’t installed JRE in quite a while. With that being said, it looks like there are now 2 installers (exe and msi), and each has a method to define configurations.

EXE appears to prefer a configuration file: https://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_installer_options.html

MSI supports additional switches and/or a config file:

https://docs.oracle.com/javacomponents/doc/install-guide/use-installer-configuration-file-install-jre.htm#JSMSI-GUID-27F7BF81-6CFD-4533-96AD-F962D22A0DF5


As an Automox best practice, I would suggest using an alternate directory for your log file. the amagent directory is the running directory for the Automox agent, and content may not persist through agent actions, or upgrades. There will be cases where this directory permissions are reset by the agent as well.

Userlevel 3
Badge

We just had the same thing happen. Rolled out patches to 2500 computers and for some reason automox decided to uninstall java off a bunch of them. I haven’t figured out why it removed it off some and not others. What a mess it caused with our finance department. I seen an earlier post from Automox saying that Oracle is not longer allowing third parties to patch java 8, but that’s no reason to just remove it.

Userlevel 3

Hello David_Mitchell and rmullen,

This shouldnt be something Automox would do normally. It does sound like a bug. Have either of you submitted a ticket about this? If not can you submit one to support@automox.com with machine names this happened on?

Userlevel 3
Badge

Thanks Brandon. Yes, opened a ticket and it looks like you were the one to grab it.

Userlevel 3

Ok I have confirmed this does appear to be a bug on Automox’s side. We are going to work on getting a ticket in for this soon.

Reply