Цитата RapMan:
как с помощь Form Designer можно заюзать свою страницу в Inno Setup ? »
|
Открываете Form Designer создаёте страницу и копируете код из вкладки
Пример кода. Затем вставляете в свой скрипт.
Пример
Код:
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
SampleForm_Caption=SampleForm Caption
SampleForm_Description=SampleForm Description
SampleForm_Label1_Caption0=This is a demo label
SampleForm_Button1_Caption0=Button1
SampleForm_Button2_Caption0=Button2
SampleForm_ListBox1_Line0=Line1
SampleForm_ListBox1_Line1=Line2
SampleForm_ListBox1_Line2=Line3
SampleForm_ListBox1_Line3=Line4
SampleForm_ListBox1_Line4=Line5
SampleForm_CheckBox1_Caption0=CheckBox1
SampleForm_CheckBox2_Caption0=CheckBox2
SampleForm_CheckBox3_Caption0=CheckBox3
SampleForm_RadioButton1_Caption0=RadioButton1
SampleForm_RadioButton2_Caption0=RadioButton2
[Code]
var
Label1: TLabel;
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
ListBox1: TListBox;
NewProgressBar1: TNewProgressBar;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
Panel2: TPanel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
{ SampleForm_Activate }
procedure SampleForm_Activate(Page: TWizardPage);
begin
// enter code here...
end;
{ SampleForm_ShouldSkipPage }
function SampleForm_ShouldSkipPage(Page: TWizardPage): Boolean;
begin
Result := False;
end;
{ SampleForm_BackButtonClick }
function SampleForm_BackButtonClick(Page: TWizardPage): Boolean;
begin
Result := True;
end;
{ SampleForm_NextkButtonClick }
function SampleForm_NextButtonClick(Page: TWizardPage): Boolean;
begin
Result := True;
end;
{ SampleForm_CancelButtonClick }
procedure SampleForm_CancelButtonClick(Page: TWizardPage; var Cancel, Confirm: Boolean);
begin
// enter code here...
end;
{ SampleForm_CreatePage }
function SampleForm_CreatePage(PreviousPageId: Integer): Integer;
var
Page: TWizardPage;
begin
Page := CreateCustomPage(
PreviousPageId,
ExpandConstant('{cm:SampleForm_Caption}'),
ExpandConstant('{cm:SampleForm_Description}')
);
{ Label1 }
Label1 := TLabel.Create(Page);
with Label1 do
begin
Parent := Page.Surface;
Caption := ExpandConstant('{cm:SampleForm_Label1_Caption0}');
Left := ScaleX(16);
Top := ScaleY(8);
Width := ScaleX(92);
Height := ScaleY(13);
end;
{ Panel1 }
Panel1 := TPanel.Create(Page);
with Panel1 do
begin
Parent := Page.Surface;
Left := ScaleX(8);
Top := ScaleY(32);
Width := ScaleX(393);
Height := ScaleY(193);
BevelInner := bvLowered;
BevelWidth := ScaleX(2);
BorderStyle := bsSingle;
TabOrder := 0;
end;
{ Button1 }
Button1 := TButton.Create(Page);
with Button1 do
begin
Parent := Panel1;
Caption := ExpandConstant('{cm:SampleForm_Button1_Caption0}');
Left := ScaleX(14);
Top := ScaleY(14);
Width := ScaleX(75);
Height := ScaleY(23);
TabOrder := 0;
end;
{ Button2 }
Button2 := TButton.Create(Page);
with Button2 do
begin
Parent := Panel1;
Caption := ExpandConstant('{cm:SampleForm_Button2_Caption0}');
Left := ScaleX(94);
Top := ScaleY(14);
Width := ScaleX(75);
Height := ScaleY(23);
TabOrder := 1;
end;
{ ListBox1 }
ListBox1 := TListBox.Create(Page);
with ListBox1 do
begin
Parent := Panel1;
Left := ScaleX(14);
Top := ScaleY(46);
Width := ScaleX(153);
Height := ScaleY(129);
Items.Add(ExpandConstant('{cm:SampleForm_ListBox1_Line0}'));
Items.Add(ExpandConstant('{cm:SampleForm_ListBox1_Line1}'));
Items.Add(ExpandConstant('{cm:SampleForm_ListBox1_Line2}'));
Items.Add(ExpandConstant('{cm:SampleForm_ListBox1_Line3}'));
Items.Add(ExpandConstant('{cm:SampleForm_ListBox1_Line4}'));
TabOrder := 2;
end;
{ NewProgressBar1 }
NewProgressBar1 := TNewProgressBar.Create(Page);
with NewProgressBar1 do
begin
Parent := Panel1;
Left := ScaleX(174);
Top := ScaleY(158);
Width := ScaleX(206);
Height := ScaleY(17);
Min := 0;
Max := 100;
Position := 50;
end;
{ CheckBox1 }
CheckBox1 := TCheckBox.Create(Page);
with CheckBox1 do
begin
Parent := Panel1;
Caption := ExpandConstant('{cm:SampleForm_CheckBox1_Caption0}');
Left := ScaleX(182);
Top := ScaleY(14);
Width := ScaleX(97);
Height := ScaleY(17);
Font.Height := ScaleY(-11);
Font.Name := 'Tahoma';
TabOrder := 3;
end;
{ CheckBox2 }
CheckBox2 := TCheckBox.Create(Page);
with CheckBox2 do
begin
Parent := Panel1;
Caption := ExpandConstant('{cm:SampleForm_CheckBox2_Caption0}');
Left := ScaleX(182);
Top := ScaleY(38);
Width := ScaleX(97);
Height := ScaleY(17);
TabOrder := 4;
end;
{ CheckBox3 }
CheckBox3 := TCheckBox.Create(Page);
with CheckBox3 do
begin
Parent := Panel1;
Caption := ExpandConstant('{cm:SampleForm_CheckBox3_Caption0}');
Left := ScaleX(182);
Top := ScaleY(62);
Width := ScaleX(97);
Height := ScaleY(17);
TabOrder := 5;
end;
{ Panel2 }
Panel2 := TPanel.Create(Page);
with Panel2 do
begin
Parent := Panel1;
Left := ScaleX(174);
Top := ScaleY(88);
Width := ScaleX(205);
Height := ScaleY(59);
TabOrder := 6;
end;
{ RadioButton1 }
RadioButton1 := TRadioButton.Create(Page);
with RadioButton1 do
begin
Parent := Panel2;
Caption := ExpandConstant('{cm:SampleForm_RadioButton1_Caption0}');
Left := ScaleX(16);
Top := ScaleY(8);
Width := ScaleX(113);
Height := ScaleY(17);
TabOrder := 0;
end;
{ RadioButton2 }
RadioButton2 := TRadioButton.Create(Page);
with RadioButton2 do
begin
Parent := Panel2;
Caption := ExpandConstant('{cm:SampleForm_RadioButton2_Caption0}');
Left := ScaleX(16);
Top := ScaleY(32);
Width := ScaleX(113);
Height := ScaleY(17);
TabOrder := 1;
end;
with Page do
begin
OnActivate := @SampleForm_Activate;
OnShouldSkipPage := @SampleForm_ShouldSkipPage;
OnBackButtonClick := @SampleForm_BackButtonClick;
OnNextButtonClick := @SampleForm_NextButtonClick;
OnCancelButtonClick := @SampleForm_CancelButtonClick;
end;
Result := Page.ID;
end;
{ SampleForm_InitializeWizard }
procedure InitializeWizard();
begin
SampleForm_CreatePage(wpWelcome);
end;