无法使用 Install4j 更新 JAR 属性文件
Cannot update JAR properties file with Install4j
我创建了一个新的 "Configuration form" 屏幕,其中包含多个文本输入。我的目标是使用这些输入变量并将它们合并到一个属性文件中。
我使用的是 6.1.6 版 - 因此我为此创建了 "Modify a ZIP file" 操作并将其放在安装程序的安装文件下。
在 "Modification actions" 属性 的动作中,我创建了新的 "Write properties to file" 动作,并在其内部 "Source of property definitions" 我选择 安装程序变量选项 。然后它让我绑定我之前定义的变量,这很有意义。
我的问题是 运行 安装程序后,属性文件不会得到更新。打开 installation.log 时,我收到下一条消息:
[ERROR] com.install4j.runtime.beans.actions.properties.WritePropertiesFileAction [ID 1540]: Properties source variable db.database is not an instance of java.util.Map
- 如何将变量定义为 Map 类型?
- 我不确定 "Modify a ZIP file" 操作的确切位置 - 将它放在 安装文件 部分下是好的,还是我应该将它放在new "Configuration form" 我创建了?
更新:
我将我的变量名称设置为:“${installer:db.database}”,这应该将它放在地图中,但现在我仍然收到错误消息:
[ERROR] com.install4j.runtime.beans.actions.properties.WritePropertiesFileAction [ID 1540]: Properties source variable postgres has not been set
under the "Source of property definitions" I choose the Installer variable option.
在这种情况下,您必须将安装程序变量设置为一个映射,其中包含应保存到 属性 文件中的所有变量定义。
我宁愿将 "Source of property definitions" 属性 设置为 "Direct entry"。在 "Property definitions" 子 属性 中添加所有属性的定义,如下所示:
A=${installer:A}
B=${installer:B}
...
我创建了一个新的 "Configuration form" 屏幕,其中包含多个文本输入。我的目标是使用这些输入变量并将它们合并到一个属性文件中。
我使用的是 6.1.6 版 - 因此我为此创建了 "Modify a ZIP file" 操作并将其放在安装程序的安装文件下。 在 "Modification actions" 属性 的动作中,我创建了新的 "Write properties to file" 动作,并在其内部 "Source of property definitions" 我选择 安装程序变量选项 。然后它让我绑定我之前定义的变量,这很有意义。
我的问题是 运行 安装程序后,属性文件不会得到更新。打开 installation.log 时,我收到下一条消息:
[ERROR] com.install4j.runtime.beans.actions.properties.WritePropertiesFileAction [ID 1540]: Properties source variable db.database is not an instance of java.util.Map
- 如何将变量定义为 Map 类型?
- 我不确定 "Modify a ZIP file" 操作的确切位置 - 将它放在 安装文件 部分下是好的,还是我应该将它放在new "Configuration form" 我创建了?
更新:
我将我的变量名称设置为:“${installer:db.database}”,这应该将它放在地图中,但现在我仍然收到错误消息:
[ERROR] com.install4j.runtime.beans.actions.properties.WritePropertiesFileAction [ID 1540]: Properties source variable postgres has not been set
under the "Source of property definitions" I choose the Installer variable option.
在这种情况下,您必须将安装程序变量设置为一个映射,其中包含应保存到 属性 文件中的所有变量定义。
我宁愿将 "Source of property definitions" 属性 设置为 "Direct entry"。在 "Property definitions" 子 属性 中添加所有属性的定义,如下所示:
A=${installer:A}
B=${installer:B}
...