是否可以自定义Install4j启动器以根据退出代码重新启动应用程序进程 [英] Is it possible to customize Install4j launcher to restart application process based on exit code

查看:157
本文介绍了是否可以自定义Install4j启动器以根据退出代码重新启动应用程序进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果由于退出代码0以外的原因导致进程终止,是否可以使用install4j多平台启动器自动重启?

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

根据启动器脚本com.install4j.runtime.launcher.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?

推荐答案

从install4j 5.1.12开始,没有基于退出代码的重新启动功能可用.

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

相反,您可以添加一个自定义安装程序应用程序,该应用程序通过关闭呼叫启动程序"操作关闭启动程序,并通过执行启动程序"操作再次启动启动程序.为此,您必须通过com.install4j.api.launcher.ApplicationLauncher API启动自定义安装程序.如果不显示任何GUI,则应将自定义安装程序的默认执行模式"属性设置为无人参与模式".

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".

这样,您还可以在其间替换jar文件或其他锁定文件.

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

这篇关于是否可以自定义Install4j启动器以根据退出代码重新启动应用程序进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆