cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SpiderLily1
Level 6

Is(FILE_LOCKED) not working to detect if uninstalled java.exe running

I have installscript code that uses Is(FILE_LOCKED) to check several .exe's and java.exe to determine if they are running.  The path to all of the .exe's is supplied.  The paths to various (installed) java.exe's is found via a registry check in the Javasoft key.  That works as intended.

Sometimes Java does not have a registry key - it is just unzipped, and referenced with the "JAVA_HOME" variable.  So I used the GetEnvVar ("JAVA_HOME", svValue) function to get the path to Java, and then appended "\\bin\\java.exe."  I verified that the installer knows the correct path.   However, in this one circumstance, Is(FILE_LOCKED) doesn't work.

Our application "MyApp.exe" launches with Java.  When running correctly, "MyApp.exe" and the Java binary will be running.    Currently, Is(FILE_LOCKED) correctly tells when MyApp.exe is running, but not Java.  When MyApp.exe is running when I try to install a patch, the Is(FILE_LOCKED) function lists "MyApp.exe" in a list of "Files in Use."  If I kill MyApp.exe from Task Manager, the MyApp GUI remains open, and the Java binary is still running, so there are still locked files, but re-running the Is(FILE_LOCKED) function shows everything is fine, and the install will continue.  It shouldn't do that!

I'm using Amazon Corretto OpenJDK 8.  The JAVA_HOME path is C:\Users\Public\amazon-corretto-java\jdk1.8.0_222, to make sure it was accessible.

Does anyone have a clue what's going on?  Is there some other way I can do this?

Labels (1)
0 Kudos
2 Replies
SpiderLily1
Level 6

I think I figured it out.  When I look at the properties of the Java binary running in Task Manager, the path of the java.exe is cut off.   The "MyApp" launcher wasn't using C:\Users\Public\amazon-corretto-java\jdk1.8.0_222\bin\java.exe.  It was using C:\Users\Public\amazon-corretto-java\jdk1.8.0_222\jre\bin\java.exe.

So I didn't have the right path afterall.

0 Kudos

This information can be gotten to just by enlisted individuals whenever and anyplace. Mandspeoplesystem makes it simple for every one of the representatives to get to their payslips quickly paying little heed to the spot and time.

 
0 Kudos