toasterking of BS Corporation Terminus
11/15/2017 - 4:41 PM

This is a snippet of code for a Java Runtime upgrade that was never used in the interest of simplifying task code. It handles a scenario in

This is a snippet of code for a Java Runtime upgrade that was never used in the interest of simplifying task code. It handles a scenario in which some Java applet is holding the Java Runtime in use and attempts to determine if the Centricity Doctor Agent Service is the culprit.

//If Java is running and Centricity Doctor Agent Service is installed
if {(exists running application whose (name of it as lowercase is "jp2launcher.exe") or exists running application whose (name of it as lowercase is "java.exe") or exists running application whose (name of it as lowercase is "javaw.exe")) and exists service "Doctor-Agent"}
	//Stop the Centricity Doctor Agent Service.
	wait net stop Doctor-Agent
  //If Java is still running after the Centricity Doctor Agent Service is stopped
  if {exists running application whose (name of it as lowercase is "jp2launcher.exe") or exists running application whose (name of it as lowercase is "java.exe") or exists running application whose (name of it as lowercase is "javaw.exe")}
  	//Start the Centricity Doctor Agent Service again.
  	wait net start Doctor-Agent
  	//End the execution here.  Some process besides the Centricity Doctor Agent Service was apparently using Java.
  	continue if {false}
  endif
endif

//Commands to upgrade Java here...

//Start the Centricity Doctor Agent Service again.
wait net start Doctor-Agent