- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
IzPack TargetPanel 允许用户选择一个目标目录。但是,我需要允许用户选择两项(一项用于应用程序,一项用于数据)。如何做到这一点?
最佳答案
您可以创建 UserInputPanel
并从用户处获取路径作为变量。然后你可以在任何你想要的地方使用变量替换。您必须添加 userInputSpec.xml
文件并定义您自己的面板(任意数量)。要获取目录,请使用 <field type="dir" ... >
示例 userInputSpec.xml
来 self 的一个应用程序。我将 mongoDB 包含在安装程序中,并使用它来获取一些设置。
<userInput>
<panel order="0">
<createForPack name="MongoDB" />
<!-- Other settings like port, ip, username, password-->
<field type="staticText" align="left" txt="Select the catalogue where data will be stored." id="staticText.registry.db.data.text" />
<field type="dir" align="left" variable="mongo.data.dir">
<spec txt="Data directory" size="25" set="$INSTALL_PATH\data" mustExist="false" create="true" />
</field>
</panel>
<panel order="1">
<!-- definition of a second panel -->
</panel>
</userInput>
您还需要包含userInputSpec.xml
作为主安装文件中的资源并添加 UserInputPanel
您在 userInputSpec.xml
中定义的每个面板的元素
像这样(在 <installation>
元素中:
<resources>
<!-- other resources -->
<res id="userInputSpec.xml" src="userInputSpec.xml" />
</resources>
<panels>
<panel classname="HelloPanel"/>
<panel classname="InfoPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="TreePacksPanel"/>
<panel classname="UserInputPanel"/>
<panel classname="UserInputPanel"/>
<panel classname="InstallPanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="FinishPanel"/>
</panels>
注意两次出现 我在 userInputSpec 中定义了两个面板
确保您的 UserInputPanels
出现在InstallPanel
之前因为在复制文件之前您必须从用户那里获取变量。
这只是我的应用程序的一个示例。请参阅官方文档以了解我使用的元素和属性的含义。有许多功能与用户输入相关。
关于java - IzPack TargetPanel 是否允许选择多个目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10754062/
我正在运行 izpack 版本 4,并且我正在尝试使用 java 条件。 Java 类(减去导入和 try/catch)-编辑 - version.properties 位于我的 Test.jar 文
我正在创建 JAVA swing 应用程序。目标是使该应用程序可安装并以 exe 或 JAR 形式分发,以便安装在不同的基于 Windows 的计算机上。我正在使用 IZpack 来实现此目的。 我的
我正在为我的一个 Java 项目使用 Maven 和 izpack-maven-plugin。 我的 izpack 文件在 ${basedir}/izpack 中。 我的 install.xml 文件
我的安装 widget.zip zip 文件包含以下内容: 32位Java 安装.jar widgetinstaller.exe widgetinstaller.ini widgetinstaller
我发现了一些很棒的 IzPack 教程,它非常适合将我的程序安装到文件夹中。是否可以使用 IzPack 将这些文件夹的内容打包到可执行 jar 中?我的目标是让可执行 jar 调用我的 python
我在 install.xml 中定义了以下条件。 $SYSTEM_java_version 1.6 我有这个文件,我只想在 JRE 版本为 1.
我有一个 izpack 安装程序,其中包含我的项目和一个媒体文件夹(500 MB)。当我启动安装程序时,我必须等待几秒钟,因为它会解压所有文件。 我的问题是:我可以选择包外的文件(媒体文件夹)将其复制
我已经无计可施了。 我有一个非常简单的 izpack 安装描述符,用于 Windows 上的两包 Java 应用程序。除了创建快捷方式之外,一切都按预期进行。首先,快捷方式面板似乎不太正确。显示标签“
我正在使用 Izpack 为我的 java 项目创建安装程序。现在,我的要求是,我想通过从属性文件而不是用户界面获取用户输入来运行安装程序。 浏览 Izpack 文档,我发现可以使用以下两个命令来完成
我已经使用 ANT 集成制作了一个安装程序,并且构建也成功了。我尝试在 ubuntu 上测试安装程序 jar,但它没有在 Windows 7 中实例化。我使用的 Izpack 版本是 izpack-d
我正在尝试为 IzPack 安装程序创建自定义面板。这意味着我必须扩展 IzPanel。但是,看来如果我这样做,扩展面板 needs to be in com.izforge.izpack.panel
我正在尝试让 Headless Installer 工作(从远程 Linux 的命令行安装) 但每次我运行命令时,我都会立即得到这个 java -jar install.jar -console [
我已经使用 izpack 创建了安装程序和卸载程序。我面临的问题是,当我取消安装时,它会删除我安装的所有内容。我想根据我的配置自定义我的卸载程序,因为我需要保留费用文件并在运行我的 unisntall
我正在尝试找出如何让 IzPack 替换文本文件中的变量。看起来这应该是一件简单的事情,但我找不到使用他们现有文档执行此操作的具体示例。 有什么想法吗? 提前致谢。 最佳答案 我假设要处理的文件是使用
我有一个关于 Izpack 国际化的问题。 我使用的默认语言是英语。但如果用户选择罗马尼亚语,我想为安装程序中的每个自定义元素添加国际化。 例如:
如何设置跟随字段消息中的颜色?文本“请输入 Jboss 目录名称。”应显示为红色。 最佳答案 查看源代码,描述字段支持 HTML 渲染(它正在查找文本的开头和结尾),因此以下内容应该有效: P
IzPack TargetPanel 允许用户选择一个目标目录。但是,我需要允许用户选择两项(一项用于应用程序,一项用于数据)。如何做到这一点? 最佳答案 您可以创建 UserInputPanel并从
我正在寻找创建 izpack 安装的校验和、哈希值或符号的方法。我怎样才能做到这一点? 最佳答案 ant有一个可用于生成/验证文件校验和的任务。 请参阅HERE对于 任务。 关于java - 使用 i
我有一个简单的安装程序,不使用自定义面板,只需安装一个包。 该包有两个文件集元素,每个文件集元素均受 元素限制。
我有一个旧的 ant 脚本,我正在尝试运行它来为某些旧软件创建安装程序。 即使我安装了 IzPack 5.0,检查是否安装 IzPack 失败 这是该检查的 ant 文件段:
我是一名优秀的程序员,十分优秀!