Install4j: Is there a way to override the welcome message with a text containing placeholders?

荒凉一梦 提交于 2020-05-16 19:12:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!