Вопрос Активация языка в Metro Redux через секцию Components

  • Автор темы Автор темы dixen18
  • Дата начала Дата начала

dixen18

Ветеран
Всем добра)
Собственно, вопрос кроется в названии темы. Что требуется? В корне игры лежит файл конфигурации user.cfg, в котором меня интересуют две строчки - lang_sound ru и lang_text ru.
Как сделать чтоб инсталлятор прописывал тот язык (ru, us, uk), который будет выбран во время установки?
 
dixen18, что за файл? По возможности выложи его, глянем.
 
nik1967, Вот этот файлик http://sendfile.su/1476581
Строки 106 и 107
Языков много и они не вырезаются (Вшиты в VFS архивы). Но в инсталляторе думаю оставить Русский, английский и украинский..На текст и звук
Игра Metro 2033 Redux, GOG-издание
 
Код:
[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;
Ну и по аналогии, если нужно еще.
 
Последнее редактирование:
Назад
Сверху