公司的ECam Unicode版本已经要发布了。
Installshield 中安装界面中可以让你选择语言的。那么应用程序的多国语言选择也可以根据这个来选择。
如果得到我在第一个语言选择界面所选择的语言来选择应用程序界面(不仅仅是安装界面的语言)。
我们的策略是如果用户在安装的时候选择了某种语言的话,那么我们可以将用户所选择的语言写到Profile(ini)文件中,然后应用程序界面中字符串资源在加载的时候读取这个Profile中相应Key,然后根据这个Key,加载对于语言的字符串资源。
(事先已经将应用程序中使用到的字符串全部提取出来,分配唯一的Key,然后不同的语言版本,在配置文件中给不同的Key不同的值,然后应用程序只管选择对于语言的字符串配置文件,然后读取唯一的Key值即可)。
而发布包要做的就是要将安装界面选择的语言正确的写到一个语言选择的配置文件中。这样应用程序才知道要选择哪个语言版本的字符串配置文件。
其实就是一个Switch。。。。。。。Case语句。
switch(SELECTED_LANGUAGE)
case ISLANG_CHINESE_SIMPLIFIED
处理语句,Break;
case ISLANG_CHINESE_TRADITIONAL
处理语句,Break;
case ISLANG_ENGLISH:
处理语句, Break;
endswitch;
笔记:InstallScript 所支持的语言。
Language Support for InstallScript
The table below shows the languages supported by the Premier edition of InstallShield. Following are descriptions of each of the columns:
InstallShield Language—Name used by the InstallShield interface to refer to this language. InstallScript Constant—Language constant provided by InstallShield for filtering language-specific components. English Windows 95, NT 4.0, and Later Equivalent—Name that those versions of English Windows use to refer to the language.
读取Profile(ini)文件
NUMBER nvSelectDriver;
STRING szPath;
szPath = SRCDIR ^ "//Drivers//driver.ini“;
GetProfInt (szPath, "Drivers", "SelectDriver", nvSelectDriver); if( 1 == nvSelectDriver ) then g_bSelectDriver = TRUE;
WriteProfInt ("c://Test.ini", "Windows", "KeyboardDelay", 100);
WriteProfString ("C://Test.ini", "Windows", "KeyboardDelay", "100");
GetProfString ( szFileName, szSectionName, szKeyName, svResult );
注意: WriteProString是从ini文件的开头开始写,会把Config文件原来已经有的内容删除掉。
所以如果只是要在原来文件的基础上添加一个Key,那么使用
AddProfString ( szFileName, szSectionName, szKeyName, szValue );