Код:

[setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}
ShowLanguageDialog=auto
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
Name: eng; MessagesFile: compiler:Default.isl
[CustomMessages]
; Русский
rusButtonBack=< &Назад
rusButtonNext=&Далее >
rusButtonCancel=Отмена
rusSetupWindowTitle=Установка — %1
rusWelcomeLabel1=Вас приветствует Мастер установки %1
rusWelcomeLabel2=Программа установит %1, версия %2 на Ваш компьютер.%n%nРекомендуется закрыть все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.
rustest=футбол
rusfish=рыбалка
rusjoke=прикол
; English
engButtonBack=< &Back
engButtonNext=&Next >
engButtonCancel=Cancel
engSetupWindowTitle=Setup — %1
engWelcomeLabel1=Welcome to the %1 Setup Wizard
engWelcomeLabel2=This will install %1 version %2 on your computer.%n%nIt is recommended that you close all other applications before continuing.%n%nClick Next to continue, or Cancel to exit Setup.
engtest=football
engfish=fishing
engjoke=joke
[Code]
var
lang: String;
langBtn: TButton;
test, fish, joke: TNewCheckBox;
procedure ChangeLang();
begin
WizardForm.BackButton.Caption:= CustomMessage(lang+'ButtonBack');
WizardForm.NextButton.Caption:= CustomMessage(lang+'ButtonNext');
WizardForm.CancelButton.Caption:= CustomMessage(lang+'ButtonCancel');
WizardForm.Caption:= FmtMessage(CustomMessage(lang+'SetupWindowTitle'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel2.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel2'), ['{#SetupSetting('AppName')}', '{#SetupSetting('AppVersion')}']);
//добавляем свои элементы (чекбоксы, радиокнопки, лейблы и т.д.)
test.Caption := CustomMessage(lang+'test');
fish.Caption := CustomMessage(lang+'fish');
joke.Caption := CustomMessage(lang+'joke');
end;
procedure LangBtnClick(Sender: TObject);
begin
if lang='rus' then begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end else begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end;
ChangeLang();
end;
procedure RedesignWizardForm;
begin
{ test }
test := TNewCheckBox.Create(WizardForm);
with test do
begin
Parent := WizardForm.WelcomePage;
Left := ScaleX(184);
Top := ScaleY(200);
Width := ScaleX(65);
Height := ScaleY(17);
Caption := 'футбол';
end;
{ fish }
fish := TNewCheckBox.Create(WizardForm);
with fish do
begin
Parent := WizardForm.WelcomePage;
Left := ScaleX(184);
Top := ScaleY(224);
Width := ScaleX(65);
Height := ScaleY(17);
Caption := 'рыбалка';
end;
{ joke }
joke := TNewCheckBox.Create(WizardForm);
with joke do
begin
Parent := WizardForm.WelcomePage;
Left := ScaleX(184);
Top := ScaleY(248);
Width := ScaleX(65);
Height := ScaleY(17);
Caption := 'прикол';
end;
end;
procedure InitializeWizard;
begin
RedesignWizardForm;
langBtn:= TButton.Create(WizardForm);
with langBtn do begin
SetBounds(10,WizardForm.CancelButton.Top,30,WizardForm.CancelButton.Height)
OnClick:= @LangBtnClick;
Parent:= WizardForm;
end;
if ActiveLanguage='rus' then begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end else begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end;
end;