根据 Inno Setup 中的语言更改 AppName 和 AppDir
自从我阅读有关 InnoSetup 的一些问题/答案以来已经有一段时间了,但它们似乎都没有帮助我......我想根据所选的语言更改 AppName 值,可用英语和西班牙语。因此,如果提示对话框时选择的语言是西班牙语,则 AppName 值应为“La Bola”;否则,如果选择英语,则 AppName 值应为“The Ball”。
同样的事情也适用于 AppDir。到目前为止我发现的唯一的就是这个 Inno setup 和 DefaultDirName,但我无法制作它与语言一起使用。还尝试按照以下示例使用 ISPP 条件:
#ifdef AppEnterprise
#define AppName "My Program Enterprise Edition"
#else
#define AppName "My Program"
#endif
但我无法使其与该语言一起使用,因为我不知道如何操作。
可以改变吗? =/
你好!
It's been a while since I was reading some questions/answers concerning InnoSetup, but none of them seems to help me... I want to change the AppName value depending on the language selected, being available English and Spanish. So, if the language chosen when prompted the dialog were Spanish, the AppName value should be "La Bola"; otherwise, if chosen English, the AppName value should be "The Ball".
The same thing applied to the AppDir. The only thing I've found so far was this Inno setup and DefaultDirName, but I cannot make it work with the Languages. Also tried using ISPP conditionals following an example:
#ifdef AppEnterprise
#define AppName "My Program Enterprise Edition"
#else
#define AppName "My Program"
#endif
but yet I cannot make it work with the Language, since I don't know how.
Is it possible to change it? =/
Greetings!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有同样的问题,所以我发布一个答案,以便其他人更快地得到它。
实际上,Inno Setup 安装文件夹中的
Examples\Languages.iss
文件中有一个示例。简而言之:
然后
然后
就是这样。有关更多详细信息,请参阅示例。顺便说一下,请注意有一个
LicenseFile
语言属性可用(示例中未提及):I had the same question, so I'm posting an answer that would allow others to get it faster.
Actually, there is an example in
Examples\Languages.iss
file in Inno Setup installation folder.To be short:
then
then
That's it. For more details, see the example. By the way, note that there is a
LicenseFile
language attribute available (this is not mentioned in the example):查看可以翻译成不同语言的
CustomMessages
,然后可以通过{cm: 在
常量。AppName
和DefaultDirName
中使用它们。 .}Look at
CustomMessages
which can be translated into different languages, These can then be used inAppName
andDefaultDirName
with the{cm:..}
constant.ISPP 是一个预处理器,因此这意味着此代码在编译 SETUP.EXE 之前运行。AppName
可用于多种用途,但其中一个是 SETUP.EXE 资源。这就是为什么它不能在运行时使用
{code: }
设置,因此您可以在编译时为每种语言提供不同的 SETUP.EXE。
您可以通过多种方式执行此操作,例如使用 ISPP,这里是其中一种。
ISPP is a Pre-Processor, so this means this code run's prior to compiling the SETUP.EXE
The AppName is used for a variety of purposes but one is the SETUP.EXE Resource. Which is why it can't be set at runtime using
{code: }
So you could a compile time and have a different SETUP.EXE for each language.
You can do this in a number of ways, using the ISPP, here is one.