我有一个izpack安装程序,并在其中包含我的项目与一个媒体文件夹(500 MB)。当我启动安装程序时,我必须等待几秒钟,因为它会解包所有文件。IZPack将外部文件复制到安装路径
我的问题是:我可以选择包之外的文件(媒体文件夹)以将其复制到installpath?
与谷歌,我发现只有在此页面底部的解决方案:https://groups.google.com/forum/#!topic/izpack-user/mjA6AXzSouw
我有一个izpack安装程序,并在其中包含我的项目与一个媒体文件夹(500 MB)。当我启动安装程序时,我必须等待几秒钟,因为它会解包所有文件。IZPack将外部文件复制到安装路径
我的问题是:我可以选择包之外的文件(媒体文件夹)以将其复制到installpath?
与谷歌,我发现只有在此页面底部的解决方案:https://groups.google.com/forum/#!topic/izpack-user/mjA6AXzSouw
可以运行Ant目标复制此媒体文件(来自同一.ZIP文件,其中包含installer.jar
大概提取,虽然这你决定)。
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=
"$INSTALL_PATH"
"the_file"
value=
"${the.file}"
></property> </antcall>
ANT_XML_FILE:
<target name=
"copyFile"
> <copy todir=
"${dest.dir}"
file=
"${the_file}"
/> </target>