Search code examples
nullpointerexceptionizpack

Izpack throws NullPointerException to process bat file, how to solve?


I created one installer with the PackJacket app and compiled the xml spec with the IzPack version 4.3.5 (latest stable). When I tried to run the install, the process stop's with the java NullPointerException:

Current focus owner: null
Condition is fulfilled or not existent.
checking if os constraints [Os  family windows name null version null arch null
jre null ] match current OS
matched current OS.
Condition is fulfilled or not existent.
checking if os constraints [Os  family windows name null version null arch null
jre null ] match current OS
matched current OS.
Exception in thread "processing thread" java.lang.NullPointerException
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:441)
        at com.izforge.izpack.installer.ProcessPanelWorker$ExecutableFile.run(Un
known Source)
        at com.izforge.izpack.installer.ProcessPanelWorker$ProcessingJob.run(Unk
nown Source)
        at com.izforge.izpack.installer.ProcessPanelWorker.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:619)

This is the relevant xml part:

Resource:

<res id="ProcessPanel.Spec.xml" src="Install_processPanelSpec.xml"/>

Install_processPanelSpec.xml:

<processing>
    <job name="Instalar DLL's">
        <os family="Windows"/>
        <executefile name="$INSTALL_PATH/dlls/install.bat">
            <arg/>
        </executefile>
    </job>
    <job name="Configurar Acesso ao Banco">
        <os family="Windows"/>
        <executefile name="$INSTALL_PATH/config.bat">
            <arg/>
        </executefile>
    </job>
</processing>

Solution

  • Changed to use <executable> in a <pack> instead of <processing>.

    <pack name="DLL Inner" preselected="yes" required="yes">
      <executable failure="abort" keep="false" stage="postinstall" targetfile="$INSTALL_PATH/install.bat"/>
    </pack>