当我在安装过程中执行我的应用程序时,izPack会冻结

时间:2016-07-22 14:31:34

标签: java installation izpack

我的应用程序是简单的基于摇摆的应用程序,启动并添加ico到托盘。就是这样。

如何在安装izPack后运行我的应用程序jar? 我试着用:

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

但安装冻结了。 enter image description here

当我关闭我的申请时,下一部分就可以了。 如何解决?

1 个答案:

答案 0 :(得分:2)

也许对某人有帮助。 Izpack等待申请结束。在jar中保存一些作业很有用,比如将文件从一个地方移动到另一个地方等,并关闭jar应用程序。之后izpack unrize。 但在我的情况下,我需要在安装后保持我的应用程序打开。 所以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>

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