问题
I need to override the install4j
welcome message with a text including placeholders that I will need to resolve at runtime. The values for replacement will be read from a property file.
welcomeLabel3=Text {0} another text {1}
回答1:
It's not possible to add placeholders to system messages, you have to specify the entire message. However, you can use installer variables, like this:
${installer:myVariable}
and define the installer variable with
context.setVariable("myVariable", "value");
for example in a "Run script" action. Alternatively you can use compiler variables with the syntax
${compiler:myVariable}
that are defined at compile time on the "General Settings->Compiler Variables" tab and that can be overridden externally in your build process.
After that you can override the welcome message by adding the compiler variable, previously set, to your custom localization file:
welcomeLabel3=${compiler:myVariable}
来源:https://stackoverflow.com/questions/61223673/install4j-is-there-a-way-to-override-the-welcome-message-with-a-text-containing