[Setup]
AppName = MyApp
AppVerName = MyApp
DefaultDirname = {pf}\MyApp
OutputDir=.
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Components]
Name: langtext; Description: Язык субтитров; Types: full; Flags: fixed
Name: langtext\rus; Description: Русский; Flags: exclusive disablenouninstallwarning
Name: langtext\eng; Description: Английский; Flags: exclusive disablenouninstallwarning
Name: langtext\ukr; Description: Украинский; Flags: exclusive disablenouninstallwarning
Name: langvoice; Description: Выбор озвучки; Types: full; Flags: fixed
Name: langvoice\rus; Description: Русский; Flags: exclusive disablenouninstallwarning
Name: langvoice\eng; Description: Английский; Flags: exclusive disablenouninstallwarning
Name: langvoice\ukr; Description: Украинский; Flags: exclusive disablenouninstallwarning
[code]
function ReplaceLine(strFilename,strFind,strNewLine: String): Boolean;
var
strTemp: String;
iLineCounter: Integer;
a_strTextfile: TArrayOfString;
begin
LoadStringsFromFile(strFilename,a_strTextfile);
for iLineCounter:= 0 to GetArrayLength(a_strTextfile)-1 do
if (Pos(strFind, a_strTextfile[iLineCounter]) > 0) then
a_strTextfile[iLineCounter]:= strNewLine;
SaveStringsToFile(strFilename, a_strTextfile,false);
Result:= true;
end;
procedure CurPageChanged(CurPageID: Integer);
var
strFilename,Lt,Lv: String;
begin
case CurPageID of
wpReady{wpFinished}: begin
strFilename:= ExpandConstant('{app}\user.cfg');
Lv:= 'lang_sound';
Lt:= 'lang_text';
case true of
IsComponentSelected('langtext\rus'): ReplaceLine(strFilename,Lt,Lt+' ru');
IsComponentSelected('langtext\eng'): ReplaceLine(strFilename,Lt,Lt+' en');
IsComponentSelected('langtext\ukr'): ReplaceLine(strFilename,Lt,Lt+' uk');
end;
case true of
IsComponentSelected('langvoice\rus'): ReplaceLine(strFilename,Lv,Lv+' ru');
IsComponentSelected('langvoice\eng'): ReplaceLine(strFilename,Lv,Lv+' en');
IsComponentSelected('langvoice\ukr'): ReplaceLine(strFilename,Lv,Lv+' uk');
end;
end;
end;
end;