View Single Post
  #3  
Old 30-03-2019, 11:43
HunterEmrah HunterEmrah is offline
Registered User
 
Join Date: Jan 2013
Location: Canada
Posts: 59
Thanks: 28
Thanked 15 Times in 13 Posts
HunterEmrah is on a distinguished road
how can i apply custommessage for Main files component ?

Script.iss
Code:
function TranslateComponentName(StrName: String): String;
begin
  case Trim(Uppercase(Copy(StrName, Pos('cm:', LowerCase(StrName)) + Length('cm:'), Length(StrName)))) of
    'EN', 'ENGLISH'   : Result := CustomMessage('CompEnglish');
    'FR', 'FRENCH'    : Result := CustomMessage('CompFrench');
    'DE', 'GERMAN'    : Result := CustomMessage('CompGerman');
    'IT', 'ITALIAN'   : Result := CustomMessage('CompItalian');
    'ES', 'SPANISH'   : Result := CustomMessage('CompSpanish');
    'PL', 'POLISH'    : Result := CustomMessage('CompPolish');
    'RU', 'RUSSIAN'   : Result := CustomMessage('CompRussian');
    'BR', 'BRAZILIAN' : Result := CustomMessage('CompPortugueseBrazil');
    'MX', 'MEXICAN'   : Result := CustomMessage('CompMexican');
    'CZ', 'CZECH'     : Result := CustomMessage('CompCzech');
    'CL', 'COMPLAN'   : Result := CustomMessage('CompLan');
    'CB', 'COMPBONUS' : Result := CustomMessage('CompBonus');
    'GC', 'COMPMAIN'  : Result := CustomMessage('CompMain');
    else
      Result := StrName;
  end;
end;
Code:
 ComponentsSize := 0;
  SetArrayLength(CompIndexList, 0);
  IniFile := ExpandConstant('{tmp}\Settings.ini');
  ComponentsPageAvai := GetIniBool('ComponentsSettings', 'Enable', False, IniFile);
  if ComponentsPageAvai then
  begin
    if IniKeyExists('ComponentsSettings', 'Component' + IntToStr(I) + '.Name', IniFile) then
    begin
      CompName := 'cm:COMPMAIN';
      ComponentsList.AddCheckBox(CompName, '', 0, True, False, True, True, nil);
    end;
CustomMessages.iss
Code:
English.CompMain=Main files
also tried to type {cm:CompMain} for CompName, doesn't working
Attached Images
File Type: jpg 2019-03-31_013813.jpg (150.5 KB, 156 views)
Reply With Quote