Как объединить страницу выбора компонентов и выбора папки?

Nexus

Новичок
Ребят, помогите пожалуйста)
Как объединить страницу выбора компонентов и выбора папки?
 

vint56

Ветеран
Проверенный
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

//[Types]
//Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: Game; Description: Game_Component;
Name: Game\Lokal; Description: Game_Local_Component; Flags: exclusive; Types: full;
Name: Game\Full; Description: Game_Full_Component; Flags: exclusive;

Код:
function OnShouldSkipPage(Sender: TWizardPage): Boolean;
begin
    if WizardForm.ComponentsList.Items.Count > 0 then WizardForm.Tag:= 1; // отображаются страницы выбора папки и компонентов
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
  wpSelectDir: if WizardForm.Tag = 1 then
begin
  WizardForm.SelectDirPage.Notebook.ActivePage:= WizardForm.SelectComponentsPage;
with WizardForm.SelectDirBitmapImage do
begin
  Left := ScaleX(0);
  Top := ScaleY(0);
  Parent:= WizardForm.SelectComponentsPage;
end;
with WizardForm.DirBrowseButton do
begin
  Top := ScaleY(60);
  Parent:= WizardForm.SelectComponentsPage;
end;
with WizardForm.DirEdit do
begin
    Top := ScaleY(60);
    Parent:= WizardForm.SelectComponentsPage;
end;
with WizardForm.SelectDirBrowseLabel do
begin
  Top := ScaleY(26);
  Parent:= WizardForm.SelectComponentsPage;
end;
with WizardForm.SelectDirLabel do
begin
  Top := ScaleY(0);
  Parent:= WizardForm.SelectComponentsPage;
end;
with WizardForm.ComponentsList do
begin
  Top := ScaleY(155);
  Height := ScaleY(60);
end;
with WizardForm.TypesCombo do
begin
  Top := ScaleY(128);
  Parent:= WizardForm.SelectComponentsPage;
end;
with WizardForm.SelectComponentsLabel do
begin
  Top := ScaleY(85);
end;
with WizardForm.ComponentsDiskSpaceLabel do
begin
  Top := ScaleY(220);
end;
End;
End;
End;

Procedure InitializeWizard;
Begin
  PageFromID(wpSelectDir).OnShouldSkipPage:= @OnShouldSkipPage
End;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID =wpSelectComponents)then
  Result:= True;
end;
[/SPOILER]

#define MyAppURL "https://krinkels.org/"
[Setup]
AppName=My Program
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
OutputBaseFilename=setup
DisableReadyPage=true
OutputDir=.

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Files]
Source: compiler:Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion

[Icons]
Name: {group}\My Program; Filename: {app}\My Program.exe; Components: StartMenuIcon
Name: {commondesktop}\Сайт в Интернете; Filename: "{#MyAppURL}"; Components: DesktopWeb;
Name: {commondesktop}\My Program; Filename: {app}\My Program.exe; Components: DesktopIcon;

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: DesktopIcon; Description: Создать ярлык на Рабочий столе;
Name: StartMenuIcon; Description: Создать папку в меню Пуск;
Name: DesktopWeb; Description: Создать ярлык сайта на Рабочий столе;

Код:
procedure InitializeWizard ();
begin
  with WizardForm.ComponentsList do
  begin
    Left := ScaleX(0);
    Parent:= WizardForm.SelectDirPage;
    Top := ScaleY(122);
    Height := ScaleY(83);
    Color := clMenu;
    WantTabs := True;
    //BorderStyle := bsNone;
    WizardForm.ComponentsList.Checked[0]:=True;
    WizardForm.ComponentsList.Checked[1]:=True;
    WizardForm.ComponentsList.Checked[2]:=True;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpSelectDir then
  begin
  If WizardForm.FindComponent('NextButton') is TButton
  then
  TButton(WizardForm.FindComponent('NextButton')).Caption:='Установить';
  end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID =wpSelectComponents)then
  Result:= True;
end;
[/SPOILER]
 
Последнее редактирование:

Nexus

Новичок
Спасибо огромное!)
А создание ярлыка можно вписать сюда?
 

vint56

Ветеран
Проверенный
Хамик у него в скрипте нету
добавить

procedure DeinitializeSetup();
begin
UnloadSkin();
end;
удалить
procedure DeinitializeUninstall;
begin
UnloadSkin;
end;
 

Nexus

Новичок
Всем еще раз привет!
Как растянуть окно установщика?
Скрипт приложил)
 

Вложения

Сверху