Post

Replies

Boosts

Views

Activity

Reply to Local Network Privacy Child Process Behavior
So, what’s the relationship between your launcher and this client app? Is client.jar actually an update to the code in launcher.jar? Or is this some sort of trampoline thing, where launcher.jar only exists to get client.jar running? The installed macOS .app bundle essentially acts as a bootstrapper (or trampoline) that launches the latest available version of our Java launcher. The .app bundle includes a bundled JVM and an initial version of launcher.jar. The installed .app bundle itself is never automatically updated. Updating the bundled JVM or original launcher requires reinstalling the application. Instead, we support application updates by downloading newer versions of launcher.jar and client.jar from the server. The startup process works as follows: When the user opens the .app, the bundled JVM starts the included launcher.jar. The bundled launcher checks whether a newer launcher.jar has previously been downloaded. If a newer version exists, the bundled launcher immediately starts it in a separate JVM process and exits. The active launcher provides the interface for entering server connection information. Once connected, the launcher checks the server for updated versions of launcher.jar and client.jar, downloading them as necessary. The launcher starts client.jar in another JVM process and then exits. If a newer launcher.jar was downloaded, it will be used the next time the .app starts. This means we're not actually updating the installed macOS application. We're using the installed application as an entry point to execute newer Java code downloaded from the server. The reason the server provides a client.jar and launcher.jar is because the launcher allows connecting to different versions of the server. The server is deployed with client.jars that match the server version. So the launcher could connect to a server running say version 1.0.0 and another running 1.2.0, it will just download the jar and run it when connecting and loading the client. Hopefully that explains it a little better. The process is more complex then just lauching an app.
1w
Reply to Local Network Privacy Child Process Behavior
Thank you for the NSWorkspace information. I looked into it and am not quite sure how I would create one. My app is bundled with java jpackage 17.0.19, so that launches automatically using whatever mechinism jpackage bundled to launch my launcher.jar. Once the launcher is running, and the user connects to a server, it then launches the client.jar using java's ProcessBuilder. Would launching the launcher.jar (the original app bundle) using a wrapper program to create a NSWorkspace allow the child process (that the launcher starts) to be part of the NSWorkspace? Since the java runtime is not an app bundle, I don't think NSWorkspace can open it. Here is a simplified example of how I launch the client.jar inside the launcher.jar. final var command = "<path-to_bundled-jre-inside-app-bundle>/java - jar <users-home-dir>/install-dir/jars/client.jar" ProcessBuilder pb = new ProcessBuilder(command); pb.redirectError(ProcessBuilder.Redirect.appendTo( new File(System.getProperty("user.home") + File.separator + "vcs" + File.separator + "log" + File.separator + "launcher_error.log"))); pb.redirectOutput(ProcessBuilder.Redirect.appendTo( new File(System.getProperty("user.home") + File.separator + "vcs" + File.separator + "log" + File.separator + "launcher.log"))); pb.directory(new File(jarDir)); try { // start the second JVM process pb.start(); } catch (Exception e) { log.error("Error starting client Java process", e); } closeLoadingDialog(); // The launcher exits after starting the client System.exit(0);
2w
Reply to Local Network Privacy Child Process Behavior
So, what’s the relationship between your launcher and this client app? Is client.jar actually an update to the code in launcher.jar? Or is this some sort of trampoline thing, where launcher.jar only exists to get client.jar running? The installed macOS .app bundle essentially acts as a bootstrapper (or trampoline) that launches the latest available version of our Java launcher. The .app bundle includes a bundled JVM and an initial version of launcher.jar. The installed .app bundle itself is never automatically updated. Updating the bundled JVM or original launcher requires reinstalling the application. Instead, we support application updates by downloading newer versions of launcher.jar and client.jar from the server. The startup process works as follows: When the user opens the .app, the bundled JVM starts the included launcher.jar. The bundled launcher checks whether a newer launcher.jar has previously been downloaded. If a newer version exists, the bundled launcher immediately starts it in a separate JVM process and exits. The active launcher provides the interface for entering server connection information. Once connected, the launcher checks the server for updated versions of launcher.jar and client.jar, downloading them as necessary. The launcher starts client.jar in another JVM process and then exits. If a newer launcher.jar was downloaded, it will be used the next time the .app starts. This means we're not actually updating the installed macOS application. We're using the installed application as an entry point to execute newer Java code downloaded from the server. The reason the server provides a client.jar and launcher.jar is because the launcher allows connecting to different versions of the server. The server is deployed with client.jars that match the server version. So the launcher could connect to a server running say version 1.0.0 and another running 1.2.0, it will just download the jar and run it when connecting and loading the client. Hopefully that explains it a little better. The process is more complex then just lauching an app.
Replies
Boosts
Views
Activity
1w
Reply to Local Network Privacy Child Process Behavior
Thank you for the NSWorkspace information. I looked into it and am not quite sure how I would create one. My app is bundled with java jpackage 17.0.19, so that launches automatically using whatever mechinism jpackage bundled to launch my launcher.jar. Once the launcher is running, and the user connects to a server, it then launches the client.jar using java's ProcessBuilder. Would launching the launcher.jar (the original app bundle) using a wrapper program to create a NSWorkspace allow the child process (that the launcher starts) to be part of the NSWorkspace? Since the java runtime is not an app bundle, I don't think NSWorkspace can open it. Here is a simplified example of how I launch the client.jar inside the launcher.jar. final var command = "<path-to_bundled-jre-inside-app-bundle>/java - jar <users-home-dir>/install-dir/jars/client.jar" ProcessBuilder pb = new ProcessBuilder(command); pb.redirectError(ProcessBuilder.Redirect.appendTo( new File(System.getProperty("user.home") + File.separator + "vcs" + File.separator + "log" + File.separator + "launcher_error.log"))); pb.redirectOutput(ProcessBuilder.Redirect.appendTo( new File(System.getProperty("user.home") + File.separator + "vcs" + File.separator + "log" + File.separator + "launcher.log"))); pb.directory(new File(jarDir)); try { // start the second JVM process pb.start(); } catch (Exception e) { log.error("Error starting client Java process", e); } closeLoadingDialog(); // The launcher exits after starting the client System.exit(0);
Replies
Boosts
Views
Activity
2w