是否可以根据操作系统语言运行不同的代码?

时间:2012-11-22 07:19:59

标签: inno-setup

如果根据操作系统的语言安装不同的文件 (例如英文Windows,简体中文Windows,繁体中文 Windows等)?这可能吗?

对于Ex:我想在下面做:

[code]
function InitializeSetup(): Boolean;  

if " OS Language is English" then begin
   MsgBox('This is English Version ?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDNO  
else if " OS Language is Traditional Chinese" 
   MsgBox('This is Traditional Chinese ?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDNO 
end;

1 个答案:

答案 0 :(得分:0)

您可以使用GetUILanguage支持功能来检测操作系统语言。

所以你可以像这样编码:

const
  LangEnglish = $09;
  LangSpanish = $0A;
  LangFrench = $0C;

if GetUILanguage and $3FF = LangEnglish then
  MsgBox('This is English Version!', mbInformation, MB_YES)
else if GetUILanguage and $3FF = LangSpanish then
  MsgBox('Esta es la versión en español!', mbInformation, MB_YES)
else if GetUILanguage = $0C01 then
  MsgBox('This is Arabic-Egypt Version!', mbInformation, MB_YES)

文档:language constants