[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
ShowTasksTreeLines=yes
[Components]
Name: icons; Description: {cm:AdditionalIcons}; Types: full;
Name: icons\desktop; Description: {cm:CreateDesktopIcon}; Types: full;
Name: icons\quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; OnlyBelowVersion: 0,6.1; Types: full;
Name: icons\quicklaunchicon7; Description: {cm:CreateQuickLaunchIcon}; MinVersion: 0,6.1; Types: full;
Name: Redist; Description: Дополнительное программное обеспечение: ; Types: full;
Name: Redist\Redist1; Description: Установить\Обновить Microsoft DirectX ; Types: full;
Name: Redist\Redist2; Description: Установить\Обновить Microsoft Visual C++ Redist ; Types: full;
Name: "root"; Description: "Выберите игру"; Flags: fixed; Types: full custom
Name: "root\game0"; Description: "Half-Life 2"; Flags: exclusive;
Name: "root\game1"; Description: "Portal"; Flags: exclusive;
Код:
var
ComponentsButton: TNewButton;
procedure ComponentsClick(Sender : TObject);
begin
case TButton(Sender).Tag of
0: begin
TButton(Sender).Tag := 1;
TButton(Sender).Caption := 'Компоненты';
WizardForm.ComponentsList.Show;
WizardForm.TypesCombo.Hide;
WizardForm.SelectComponentsLabel.Hide;
WizardForm.ComponentsDiskSpaceLabel.Hide;
WizardForm.PageNameLabel.Caption:='Выбор компонентов';
WizardForm.PageDescriptionLabel.Caption:='Какие компоненты должны быть установлены?';
WizardForm.SelectComponentsLabel.Show;
WizardForm.ComponentsDiskSpaceLabel.Show;
end;
1: begin
TButton(Sender).Tag := 0;
TButton(Sender).Caption := 'Компоненты';
WizardForm.ComponentsList.Hide;
WizardForm.PageNameLabel.Caption:='Выбор папки установки';
WizardForm.PageDescriptionLabel.Caption:='В какую папку вы хотите установить {#SetupSetting("AppName")}?';
WizardForm.DirEdit.Show;
WizardForm.DirBrowseButton.Show;
WizardForm.SelectDirLabel.Show;
WizardForm.SelectDirBitmapImage.Show;
end;
end;
end;
procedure InitializeWizard();
begin
ComponentsButton := TNewButton.Create(WizardForm);
with ComponentsButton do
begin
Parent := WizardForm;
SetBounds(ScaleX(25),ScaleY(325),ScaleX(100),ScaleY(25));
Caption := 'Компоненты';
OnClick := @ComponentsClick;
end;
with WizardForm.ComponentsList do
begin
Top := ScaleY(50);
Height := ScaleY(155);
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID = 7)then
Result:= True;
end;
Procedure CurPageChanged(CurPageID: Integer);
begin
ComponentsButton.Hide;
case CurPageID of
wpSelectDir:
begin
ComponentsButton.Show;
end;
end;
end;[/SPOILER]