javainstallationizpack

izPack freeze when i execute my application in installation process


My app is simple swing based app that start and add ico to tray. That is all.

How can i run my application jar after installation with izPack? I tried to use:

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

But installation is freeze. enter image description here

And next part will be able when i close my application. How to fix it?


Solution

  • Maybe it would be helpful for someone. Izpack wait for ending of application. It can be useful to hold some jobs in jar, like move file from one place to another, etc, and close jar application. After that izpack unfrize. But in my case i need to keep my application opened after installation. So stage="postinstall" is not correct for me. I wrote sh/bat for linux/windows like:

    Unix:
    #!/bin/bash
    $JAVA_HOME/bin/java -jar $INSTALL_PATH/core/updater.jar &
    
    Windows:
    start javaw -jar "$INSTALL_PATH\core\updater.jar"
    

    It opens application and hide terminal/cmd.

    In install.xml i add:

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

    And 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>
    

    So process panel start this scripts and hold application in tray.