如何使用带有预处理器常量的自定义消息的语言文件?

How can I use language files with custom messages with preprocessor constants?

我想要所有 CustomMessages 语言文件(扩展名 isl)。此外,一些消息包含预处理器常量,例如

ALREADY_INSTALLED={#MyAppName} is already installed on this computer.

消息应该这样显示:

"My-really-nice-App is already installed on this computer"

但我得到的是:

"{#MyAppName} is already installed on this computer."

当我有代码、[CustomMessages]-topic 中定义的消息和同一个 iss 文件中的 #define MyAppName 时,以下内容就像一个魅力:

MsgBox(ExpandConstant('{cm:ALREADY_INSTALLED}'), ...);

有什么线索吗?

只有 .iss 个文件被预处理,而不是 .isl 个文件。

但是你可以使用FmtMessage function:

FmtMessage(CustomMessage('ALREADY_INSTALLED'), ['{#MyAppName}'])

ALREADY_INSTALLED=%1 is already installed on this computer.

请注意,在 Pascal 脚本代码中,您最好使用 CustomMessage('FOO'),而不是 ExpandConstant('{cm:FOO}')


类似问题:.

如果您需要预处理标准消息,请参阅