Java 在安装过程中执行应用程序时izPack冻结

Java 在安装过程中执行应用程序时izPack冻结,java,installation,izpack,Java,Installation,Izpack,我的应用程序是一个简单的基于swing的应用程序,可以启动并将ico添加到托盘中。仅此而已 使用izPack安装后,如何运行我的应用程序jar? 我尝试使用: <executable stage="postinstall" targetfile="$INSTALL_PATH/core/app.jar"> </executable> 但安装是冻结的。 下一部分将在我关闭应用程序时启用。 如何修复它?也许它会对某人有所帮助。 Izpack正在等待应用程序的结束。在j

我的应用程序是一个简单的基于swing的应用程序,可以启动并将ico添加到托盘中。仅此而已

使用izPack安装后,如何运行我的应用程序jar? 我尝试使用:

<executable stage="postinstall" targetfile="$INSTALL_PATH/core/app.jar"> 
</executable>

但安装是冻结的。

下一部分将在我关闭应用程序时启用。
如何修复它?

也许它会对某人有所帮助。 Izpack正在等待应用程序的结束。在jar中保存一些作业可能很有用,比如将文件从一个地方移动到另一个地方,等等,并关闭jar应用程序。在那之后,我把它解冻。 但在我的情况下,我需要在安装后保持我的应用程序处于打开状态。 所以stage=“postinstall”对我来说是不正确的。 我为linux/windows编写了sh/bat,比如:

Unix:
#!/bin/bash
$JAVA_HOME/bin/java -jar $INSTALL_PATH/core/updater.jar &

Windows:
start javaw -jar "$INSTALL_PATH\core\updater.jar"
它打开应用程序并隐藏终端/cmd

在install.xml中,我添加:

<panels>
    <panel classname="ProcessPanel"/>
</panels>
<resources>
    <res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/>
</resources>
<packs>
    <pack name="core" required="yes">

        <fileset dir="resources/windows/scripts"
                 targetdir="$INSTALL_PATH/core/scripts">
            <os family="windows"></os>
        </fileset>

        <fileset dir="resources/linux/scripts"
                 targetdir="$INSTALL_PATH/core/scripts">
            <os family="unix"></os>
        </fileset>

        <executable targetfile="$INSTALL_PATH/core/scripts/run.sh" keep="true">
            <os family="unix"></os>
        </executable>
    </pack>
</packs>

和ProcessPanel.Spec.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<izpack:processing version="5.0" xmlns:izpack="http://izpack.org/schema/processing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://izpack.org/schema/processing http://izpack.org/schema/5.0/izpack-processing-5.0.xsd">
<job name="RunWindows">
    <os family="windows" />
    <executefile name="$INSTALL_PATH/core/scripts/run.bat" />
</job>
<job name="RunUnix">
    <os family="unix" />
    <executefile name="$INSTALL_PATH/core/scripts/run.sh" />
</job>


因此,process panel启动此脚本并将应用程序保存在托盘中。

成功了,谢谢!我不明白为什么没有一个简单的选项来运行安装后任务而不等待它完成。。。