Is it possible to customize Install4j launcher to restart application process based on exit code

丶灬走出姿态 提交于 2019-12-11 05:28:59

问题


If process terminated due to any reason other than exit code 0, is it possible to restart automatically using install4j Multi-platform launcher?

Basted on the launcher script com.install4j.runtime.launcher.Launcher is launching the process. Is there any way to customize the behavior of this class?


回答1:


As of install4j 5.1.12, no restart functionality based on the exit code is available.

Instead, you can add a custom installer application that shuts down the launcher with a "Shut down calling launcher" action and starts the launcher again with an "Execute launcher" action. For that to work, you have to start the custom installer application via the com.install4j.api.launcher.ApplicationLauncher API. If no GUI should be displayed, the "Default execution mode" property of the custom installer application should be set to "Unattended mode".

In that way you also have the opportunity to replace jar files or other locked files in between.



来源:https://stackoverflow.com/questions/24496803/is-it-possible-to-customize-install4j-launcher-to-restart-application-process-ba

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!