Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot update JAR properties file with Install4j

Tags:

install4j

I created a new "Configuration form" screen which contains several text inputs. My goal is to use these inputs variables and merge them into a properties file.

I'm using version 6.1.6 - so I created "Modify a ZIP file" action for that purpose and placed it under the installer's Install files. In the "Modification actions" property of the action I created new "Write properties to file" action and inside it under the "Source of property definitions" I choose the Installer variable option. It then let me bound the variables I defined earlier which makes sense.

My problem is after running the installer the properties file won't get update. When opening the installation.log I have the next message:

[ERROR] com.install4j.runtime.beans.actions.properties.WritePropertiesFileAction [ID 1540]: Properties source variable db.database is not an instance of java.util.Map
  1. How can I define the variable to be as a Map type?
  2. I wasn't sure about where exactly place the "Modify a ZIP file" action - is keeping it under the Install files section is fine or should I place it right under the new "Configuration form" I created?

UPDATE:

I set my variable name to be: "${installer:db.database}" which should place it within a Map and now I'm still getting an error:

[ERROR] com.install4j.runtime.beans.actions.properties.WritePropertiesFileAction [ID 1540]: Properties source variable postgres has not been set
like image 388
Nimrod Avatar asked Oct 30 '22 00:10

Nimrod


1 Answers

under the "Source of property definitions" I choose the Installer variable option.

In that case you would have to set an installer variable to a map with all variable definitions that should be saved to the property file.

I would rather set the "Source of property definitions" property to "Direct entry". In the "Property definitions" child property add definitions for all properties like this:

A=${installer:A}
B=${installer:B}
...
like image 81
Ingo Kegel Avatar answered Nov 13 '22 01:11

Ingo Kegel