【问题标题】:IZPack copy external files to installpathIZPack 将外部文件复制到安装路径
【发布时间】:2014-02-10 10:35:56
【问题描述】:

我有一个 izpack 安装程序,其中包含我的项目和一个媒体文件夹 (500 MB)。当我启动安装程序时,我必须等待几秒钟,因为它会解压缩所有文件。

我的问题是:我可以选择包外的文件(媒体文件夹)将其复制到安装路径吗?

通过谷歌,我只在本页底部找到了解决方案:https://groups.google.com/forum/#!topic/izpack-user/mjA6AXzSouw

【问题讨论】:

    标签: 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:

      &lt;field type="file" align="left" variable="the.file"> <spec txt="" size="25" set=""/> </field>

    • UserInputPanel: 要求用户通过File Chooser 字段定位并选择媒体文件。文件位置将保存在the.file 变量中,如上所示。

    • AntActionsSpec.xml:

      &lt;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:
      &lt;target name="copyFile"> <copy todir="${dest.dir}"file="${the_file}"/> </target>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-27
      • 1970-01-01
      • 2011-12-03
      • 2016-07-10
      • 2011-08-04
      • 2013-08-19
      相关资源
      最近更新 更多