2012-10-20 106 views
3

我有这个问题...我做了一个个人留言箱...我把一个非常有趣的方式英语和西班牙语...但我希望我的安装程序只显示一种语言.. 。like ...当我在菜单选择器中选择西班牙语...在该消息框中显示西班牙语...如果在菜单选择器中选择意大利语...让该消息箱显示它。Inno Setup - 更改MessageBox语言

[code] 
function NextButtonClick1(PageId: Integer): Boolean; 
begin 
    Result := True; 
    if (PageId = wpSelectDir) and not FileExists(ExpandConstant('{app}\xxx.exe')) then begin 
     MsgBox('"Thi App" does not seem to be installed in that folder. Please select the correct folder. [Selecciona la Carpeta de Instalación de la Aplicación]', mbError, MB_OK); 
     Result := False; 
     exit; 
    end; 
end; 

回答

6

使用[CustomMessages]部分,并与下面的脚本中所示一样的语言的内部名称前缀消息名称有:

[Setup] 
AppName=My Program 
AppVersion=1.5 
DefaultDirName={pf}\My Program 
OutputDir=userdocs:Inno Setup Examples Output 

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

[CustomMessages] 
en.AppCheckError=Select the application folder! 
es.AppCheckError=Selecciona la Carpeta de Instalación de la Aplicación! 

[Code] 
procedure InitializeWizard; 
begin 
    MsgBox(ExpandConstant('{cm:AppCheckError}'), mbInformation, MB_OK); 
end; 
+0

感谢很多人。你是好这个...我喜欢在我的安装程序中给你点数XD – Dielo

+1

请注意,消息框中的按钮将始终以用户的UI语言显示,无论他们选择哪种语言进行安装。 (这是Windows的工作原理。) – Miral

+0

是啊,男士......正在学习......我很久以前没有碰过这个代码的东西......非常感谢 – Dielo