bat文件目录错误?

Wrong directory of the bat file?

我正在尝试使用 IzPack 创建安装程序。我正在尝试在安装前执行一个批处理文件。

install.xml

<izpack:installation version="5.0" 
                     xmlns:izpack="http://izpack.org/schema/installation" 
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                     xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">


    <guiprefs width="640" height="480" resizable="yes"/>
     <variables>
         <variable name="DesktopShortcutCheckboxEnabled" value="true"/>
    </variables>

    <locale>
        <langpack iso3="eng"/>
    </locale>

    <resources>
        <res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/>
        <res id="shortcutSpec.xml" src="shortcutSpec.xml"/>
        <res id="LicencePanel.licence" src="License.txt"/>
        <res id="InfoPanel.info" src="Readme.txt"/>
    </resources>

    <panels>
        <panel classname="HelloPanel"/>
        <panel classname="ProcessPanel"/>
        <panel classname="LicencePanel"/>
        <panel classname="TargetPanel"/>
        <panel classname="PacksPanel"/>
        <panel classname="InstallPanel"/>
        <panel classname="ShortcutPanel"/>
        <panel classname="FinishPanel"/>
    </panels>

    <packs>
        <pack name="Base" required="yes">
            <description>The base files</description>
            <file src="Readme.txt" targetdir="$INSTALL_PATH"/>
            <file src="License.txt" targetdir="$INSTALL_PATH"/>
            <file src="phone.ico" targetdir="$INSTALL_PATH"/>
            <fileset dir="lib" targetdir="$INSTALL_PATH\lib">
                <include name="**"/>
            </fileset>
        </pack>
    </packs>

    <native type="izpack" name="ShellLink.dll"/>
    <native type="3rdparty" name="COIOSHelper.dll" stage="both">
        <os family="windows"/>
    </native>
</izpack:installation>

ProcessPanel.Spec.xml

<?xml version="1.0" encoding="UTF-8" ?>
<processing>                   
     <job name="doxyz">
         <os family="windows" />
         <executefile name="$INSTALL_PATH/scripts/mytest.bat">
             <arg>doit</arg><arg>$variable</arg>
         </executefile>
     </job>            
     <onFail previous="true" next="false" />
     <onSuccess previous="false" next="true" />
</processing>

在编译时,我没有得到任何错误!但是当我执行 install.jar 并打开 ProcessPanel 时,出现以下错误:

我使用了:

izpack-dist-5.0.6

生成安装程序,我的 java 版本是:

java version "1.8.0_66" Java(TM) SE Runtime Environment

(build 1.8.0_66-b18) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

我认为这是预期的行为。

找不到文件 $INSTALL_PATH/scripts/mytest.bat,因为面板的激活顺序可能未预安装它。 ProcessPanel 显示在 InstallPanel 之前,InstallPanel 是安装文件的那个。编译器不会抱怨这类问题,您必须自己关心它们。这或多或少是安装程序描述引入的逻辑问题,而不是 IzPack 的问题。