根据Inno Setup中的语言更改AppName和AppDir [英] Changing AppName and AppDir depending on language in Inno Setup

查看:190
本文介绍了根据Inno Setup中的语言更改AppName和AppDir的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我阅读了一些有关InnoSetup的问题/答案以来已经有一段时间了,但是这些问题/答案似乎都没有帮助我...我想根据所选语言来更改AppName值,可以使用英语和西班牙语.因此,如果提示对话框时选择的语言是西班牙语,则AppName值应为"La Bola";否则,如果选择英语,则AppName值应为"The Ball".

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".

同一件事也适用于AppDir.到目前为止,我唯一发现的是 Inno设置和DefaultDirName ,但我无法进行设置它与语言一起使用.还通过以下示例尝试使用ISPP条件:

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.

是否可以更改? =/

问候!

推荐答案

我有同样的问题,所以我发布了一个答案,其他人可以更快地获得它.

I had the same question, so I'm posting an answer that would allow others to get it faster.

实际上,Inno Setup安装文件夹中的Examples\Languages.iss文件中有一个示例.

Actually, there is an example in Examples\Languages.iss file in Inno Setup installation folder.

简而言之:

[Setup]
AppName={cm:MyAppName}

然后

[Languages]
Name: en; MessagesFile: "compiler:Default.isl"
Name: es; MessagesFile: "compiler:Languages\Spanish.isl"

然后

[CustomMessages]
en.MyAppName=The Ball
es.MyAppName=La Bola

就是这样.有关更多详细信息,请参见示例.顺便说一句,请注意,有一个LicenseFile语言属性可用(示例中未提及):

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):

[Languages]
Name: en; MessagesFile: "compiler:Default.isl"; LicenseFile: "eula_en.rtf"
Name: es; MessagesFile: "compiler:Languages\Spanish.isl"; LicenseFile: "eula_es.rtf"

这篇关于根据Inno Setup中的语言更改AppName和AppDir的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆