也许这对别人有帮助。 Izpack等待申请的结束。在jar中保存一些作业是非常有用的,比如将文件从一个地方移动到另一个地方等,然后关闭jar应用程序。在那之后izpack不吱声。 但在我的情况下,我需要保持我的应用程序在安装后打开。 因此stage =“postinstall”对我来说不正确。 我写的sh /蝙蝠Linux/Windows的,如:
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>
所以工艺面板启动这个脚本,并在托盘保存应用程序。