【问题标题】:IZPack copy external files to installpathIZPack 将外部文件复制到安装路径
【发布时间】:2014-02-10 10:35:56
【问题描述】:
【问题讨论】:
标签:
java
ant
jar
installation
izpack
【解决方案1】:
您可以运行 ANT 目标来复制此媒体文件(可能是从包含 installer.jar 的同一 .zip 文件中提取的,尽管这取决于您)。
-
install.xml:
<listeners>
<listener classname="AntActionInstallerListener" stage="install" />
<listener classname="AntActionUninstallerListener" stage="uninstall" />
</listeners>
-
UserInputSpec.xml:
<field type="file" align="left" variable="the.file">
<spec txt="" size="25" set=""/>
</field>
UserInputPanel: 要求用户通过File Chooser 字段定位并选择媒体文件。文件位置将保存在the.file 变量中,如上所示。
-
AntActionsSpec.xml:
<antcall buildfile="location of ANT_XML_FILE"order="afterpacks">
<target name="copyFile"></target>
<property name="dest.dir"value=@987654339 @></property>
<property name="the_file"value="${the.file}"></property>
</antcall>
ANT_XML_FILE:
<target name="copyFile">
<copy todir="${dest.dir}"file="${the_file}"/>
</target>