Hemanth Abbina
Hemanth Abbina

Reputation: 119

Install4j - Issue with OSX launcher

We are using install4j version 6.1.4 (build 6320) on CentOS7.

We built our installer for OSX with installer type as 'Mac OSX folder'. The installer has a launcher which will start a custom Java SystemTray application.

During the installation process, the launcher executed as expected and the SystemTray application showed up. Even after the installation process completed, the launcher still stays in the Applications Doc and not closed. This launcher won't quit from the Applications Doc until the System Tray application is closed.

When the machine is powered off, the launcher still running until we do a force quit or close the SystemTray application.

Is there a way we can close the launcher process right after the installation is completed?

---update---

The issue is specific to OSX.

The launcher is actually a JavaApplicationStub binary, and it runs the custom SystemTray application based on Java.

When we try to quit the JavaApplicationStub application (which is available on Application Doc), it's not quit until we close the SystemTray application or force quit it.

When we kill the JavaApplicationStub process, it kills the SystemTray application also.

Upvotes: 1

Views: 152

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48015

If you do not have a handle to the process, you can use the WinProcesses API to terminate a process for which you know the full path to the executable:

for (WinProcesses.Info info : infos) {
     if (info.getModuleName().equals("full path to executable")) {
         WinProcesses.terminateProcesses(new int[] {info.getProcessId()});
         return true;
     }
}

on macOS, there is a corresponding MacProcesses API:

for (MacProcesses.Info info : infos) {
     if (info.getModuleName().equals("full path to executable")) {
         MacProcesses.terminateProcesses(new int[] {info.getProcessId()});
         return true;
     }, false, 10000
}

Upvotes: 1

Related Questions