Код:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"
[Types]
Name: viborochnaya; Description: Выборочная установка; Flags: iscustom
[Components]
Name: AB;Description: Группы A и B;Flags: exclusive
Name: AB\A; Description: Группа A
Name: AB\A\A1; Description: Компонент 1;Flags: exclusive
Name: AB\A\A2; Description: Компонент 2;Flags: exclusive
Name: AB\A\A3; Description: Компонент 3;Flags: exclusive
Name: AB\A\A4; Description: Компонент 4;Flags: exclusive
Name: AB\B; Description: Группа B
Name: AB\B\B1; Description: Компонент 1;Flags: exclusive
Name: AB\B\B2; Description: Компонент 2;Flags: exclusive
Name: AB\B\B3; Description: Компонент 2;Flags: exclusive
Name: AB\B\B4; Description: Компонент 4;Flags: exclusive
[Files]
Source: compiler:Examples\MyProg.exe; DestDir: {app}; Check: Check1
Source: compiler:Examples\MyProg.chm; DestDir: {app}; Check: Check2
[Code]
function Check1: Boolean;
begin
Result:=WizardForm.ComponentsList.ItemEnabled[1] and WizardForm.ComponentsList.Checked[0];
begin
Result:=WizardForm.ComponentsList.ItemEnabled[2] and WizardForm.ComponentsList.Checked[0];
end;
end;
function Check2: Boolean;
begin
Result:=WizardForm.ComponentsList.ItemEnabled[4] and WizardForm.ComponentsList.Checked[3];
begin
Result:=WizardForm.ComponentsList.ItemEnabled[5] and WizardForm.ComponentsList.Checked[3];
end;
end;
procedure OnClickCheck(Sender: TObject);
begin
if WizardForm.ComponentsList.Checked[1] = True then
begin
WizardForm.ComponentsList.ItemEnabled[6]:=False;
WizardForm.ComponentsList.ItemEnabled[7]:=False;
WizardForm.ComponentsList.ItemEnabled[8]:=False;
WizardForm.ComponentsList.ItemEnabled[9]:=False;
WizardForm.ComponentsList.ItemEnabled[10]:=False;
end else
begin
WizardForm.ComponentsList.ItemEnabled[6]:=True;
WizardForm.ComponentsList.ItemEnabled[7]:=True;
WizardForm.ComponentsList.ItemEnabled[8]:=True;
WizardForm.ComponentsList.ItemEnabled[9]:=True;
WizardForm.ComponentsList.ItemEnabled[10]:=True;
end;
if WizardForm.ComponentsList.Checked[6] = True then
begin
WizardForm.ComponentsList.ItemEnabled[1]:=False;
WizardForm.ComponentsList.ItemEnabled[2]:=False;
WizardForm.ComponentsList.ItemEnabled[3]:=False;
WizardForm.ComponentsList.ItemEnabled[4]:=False;
WizardForm.ComponentsList.ItemEnabled[5]:=False;
end else
begin
WizardForm.ComponentsList.ItemEnabled[1]:=True;
WizardForm.ComponentsList.ItemEnabled[2]:=True;
WizardForm.ComponentsList.ItemEnabled[3]:=True;
WizardForm.ComponentsList.ItemEnabled[4]:=True;
WizardForm.ComponentsList.ItemEnabled[5]:=True;
end;
end;
procedure InitializeWizard();
begin
WizardForm.ComponentsList.Checked[1]:=True;
WizardForm.ComponentsList.ItemEnabled[6]:=False;
WizardForm.ComponentsList.ItemEnabled[7]:=False;
WizardForm.ComponentsList.ItemEnabled[8]:=False;
WizardForm.ComponentsList.ItemEnabled[9]:=False;
WizardForm.ComponentsList.ItemEnabled[10]:=False;
WizardForm.ComponentsList.OnClickCheck:=@OnClickCheck;
end;