Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для El Sanchez

Ветеран


Contributor


Сообщения: 1273
Благодарности: 1030

Профиль | Отправить PM | Цитировать


Цитата Neutron:
Доброго времени суток!
1) Подскажите, как сделать такое?
Скрин »
Neutron, только инсталлер. Требует китайского компилятора. Деинсталлятор мне банально лень рисовать .
Скрипт

Код: Выделить весь код
;5.4.2
#ifndef IS_ENHANCED
    #error Enhanced edition of Inno Setup (restools) is required to compile this script
#endif

#define AppName "Test"
#define AppVerName "Test"


[Setup]
AppName={#AppName}
AppVerName={#AppVerName}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
OutputBaseFilename=test
Compression=lzma
LicenseFile={app}\test.txt
InfoBeforeFile={app}\test.txt
InfoAfterFile={app}\test.txt
AllowNoIcons=yes
AlwaysRestart=yes
BitmapResource=bgnd:embedded\background.bmp|bar:embedded\bar.bmp|pic1:embedded\pic-1.bmp|pic2:embedded\pic-2.bmp|pic3:embedded\pic-3.bmp|pic4:embedded\pic-4.bmp

[Files]
Source: {app}\test.txt; DestDir: {app}

[Icons]
Name: {group}\Test; Filename: {app}\test.txt

[Components]
Name: a; Description: a; Types: test custom
Name: b; Description: b; Types: custom

[Types]
Name: custom; Description: custom; Flags: iscustom
Name: test; Description: test

[Tasks]
Name: test; Description: test; GroupDescription: test

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

[code]
var
    x, y, y1: Integer;
    i: Byte;

procedure InitializeWizard();
begin
    with WizardForm do
    begin
        PageNameLabel.Hide;
        PageDescriptionLabel.Hide;
        WizardBitmapImage.Hide;
        WizardBitmapImage2.Hide;
        WizardSmallBitmapImage.Hide;
        MainPanel.Hide;
        Bevel1.Hide;
        WelcomePage.Hide;
        LicenseLabel1.Hide;
        LicenseAcceptedRadio.Hide;
        LicenseNotAcceptedRadio.Hide;

        ClientHeight := ScaleY(480);
        ClientWidth := ScaleX(640);

        //WizardBitmapImage
        with TBitmapImage.Create(WizardForm) do
        begin
            Parent := WizardForm;
            Bitmap.LoadFromResourceName(HInstance, '_IS_BGND');
            Align := alClient;
            SendToBack;
        end;

        //WizardSmallBitmapImage
        with TBitmapImage.Create(WizardForm) do
        begin
            Parent := WizardForm;
            Bitmap.LoadFromResourceName(HInstance, '_IS_BAR');
            Width := Bitmap.Width;
            Height := Bitmap.Height;
            Name := 'Bar';
        end;

        //PageNameLabel
        with TLabel.Create(WizardForm) do
        begin
            Parent := WizardForm;
            Font.Size := TBitmapImage(WizardForm.FindComponent('Bar')).Height div 2 - TBitmapImage(WizardForm.FindComponent('Bar')).Height div 20;
            Font.Name := 'Arial';
            Font.Color := clWhite;
            Left := TBitmapImage(WizardForm.FindComponent('Bar')).Width div 30;
            Top := (TBitmapImage(WizardForm.FindComponent('Bar')).Height - Height) div 2;
            Transparent := True;
            Caption := ExpandConstant('{#AppVerName}');
        end;

        //Buttons
        NextButton.Left := ClientWidth - NextButton.Width - NextButton.Width div 4;
        NextButton.Top := ClientHeight - NextButton.Height - NextButton.Height div 4;
        BackButton.Left := NextButton.Left - NextButton.Width - NextButton.Width div 8;
        BackButton.Top := NextButton.Top;
        CancelButton.Left := BackButton.Left - BackButton.Width - BackButton.Width div 8;
        CancelButton.Top := NextButton.Top;

        //Bevel
        with TBevel.Create(WizardForm) do
        begin
            Parent := WizardForm;
            SetBounds(Bevel1.Left, TBitmapImage(WizardForm.FindComponent('Bar')).Height, WizardForm.ClientWidth, Bevel1.Height);
            Shape := bsFrame;
            Style := Bevel1.Style;
        end;
        Bevel.Top := NextButton.Top - NextButton.Height div 4;
        Bevel.Width := ClientWidth;
        Bevel.Shape := bsFrame;
        BeveledLabel.Top := Bevel.Top - BeveledLabel.Height div 2;

        //Notebook
        x := InnerNotebook.Width;
        y := InnerNotebook.Height - ClientHeight + Bevel.Top;
        y1 := Bevel.Top - TBitmapImage(WizardForm.FindComponent('Bar')).Height - TBitmapImage(WizardForm.FindComponent('Bar')).Height div 4;
        InnerPage.Color := clWhite;
        InnerNotebook.ScaleBy(x - x div 15, x);

        //Pics
        with TBitmapImage.Create(WizardForm) do
        begin
            Parent := WizardForm;
            Bitmap.LoadFromResourceName(HInstance, '_IS_PIC1');
            SetBounds(WizardForm.ClientWidth div 3, TBitmapImage(WizardForm.FindComponent('Bar')).Height + TBitmapImage(WizardForm.FindComponent('Bar')).Height div 6, x, Bitmap.Height);
            Name := 'Bmp';
        end;

        //ListBox
        for i := 1 to 14 do
        begin
            with TLabel.Create(WizardForm) do
            begin
                Parent := WizardForm;
                AutoSize := False;
                WordWrap := True;
                Height := 26;
                Left := WizardForm.ClientWidth div 50;
                Top := (i-1)*((Bevel.Top - Bevel1.Top - WizardForm.ClientHeight div 25)/13) + Bevel1.Top + WizardForm.ClientHeight div 75;
                Width := WizardForm.ClientWidth div 3 - WizardForm.ClientWidth div 25;
                case i of
                    1: Caption := 'Добро пожаловать!';
                    2: Caption := SetupMessage(msgWizardLicense);
                    3: Caption := SetupMessage(msgWizardPassword);
                    4: Caption := SetupMessage(msgWizardInfoBefore)
                    5: Caption := SetupMessage(msgWizardUserInfo)
                    6: Caption := SetupMessage(msgWizardSelectDir)
                    7: Caption := SetupMessage(msgWizardSelectComponents)
                    8: Caption := SetupMessage(msgWizardSelectProgramGroup)
                    9: Caption := SetupMessage(msgWizardSelectTasks)
                    10: Caption := SetupMessage(msgWizardReady)
                    11: Caption := SetupMessage(msgWizardPreparing)
                    12: Caption := SetupMessage(msgWizardUninstalling)
                    13: Caption := SetupMessage(msgWizardInfoAfter)
                    14: Caption := 'Окончание';
                end;
                Transparent := True;
                Font.Color := clWhite;
                Name := '_Label_' + IntToStr(i);
            end;
        end;

        //Other
        WelcomeLabel1.Left := x div 40;
        WelcomeLabel1.Width := x - 2*WelcomeLabel1.Left;
        WelcomeLabel2.Left := x div 40;
        WelcomeLabel2.Width := x - 2*WelcomeLabel2.Left;
        LicenseAcceptedRadio.Checked := True;
        LicenseMemo.Align := alClient;
        FinishedHeadingLabel.Left := x div 40;
        FinishedHeadingLabel.Width := x - FinishedHeadingLabel.Left;
        FinishedLabel.Left := x div 40;
        FinishedLabel.Width := x - FinishedLabel.Left;
        ComponentsList.Color := clWhite;
        TasksList.Color := clWhite;
        ReadyMemo.Color := clWhite;
        RunList.Left := x div 40;
        RunList.Width := x - RunList.Left;
        YesRadio.Left := x div 40;
        NoRadio.Left := x div 40;
    end;
end;

procedure CurPageChanged(CurPageID: Integer);
var
    i: Byte;
begin
    if CurPageID = wpLicense then
    with WizardForm do
    begin
        OuterNotebook.SetBounds(ClientWidth div 3, TBitmapImage(WizardForm.FindComponent('Bar')).Height + TBitmapImage(WizardForm.FindComponent('Bar')).Height div 6, x, y1);
        InnerNotebook.Align := alClient;
        NextButton.Caption := 'Согласен';
    end;
    //
    if CurPageID <> wpLicense then
    with WizardForm do
    begin
        OuterNotebook.SetBounds(WizardForm.ClientWidth div 3, WizardForm.ClientHeight div 2, x, y);
        InnerNotebook.Align := alNone;
    end;
    //
    if CurPageID mod 4 = 0 then
        TBitmapImage(WizardForm.FindComponent('Bmp')).Bitmap.LoadFromResourceName(HInstance, '_IS_PIC4')
    else
        TBitmapImage(WizardForm.FindComponent('Bmp')).Bitmap.LoadFromResourceName(HInstance, '_IS_PIC' + IntToStr(CurPageID mod 4));
    //
    for i := wpWelcome to wpFinished do
    begin
        if i = CurPageID then
        begin
            TLabel(WizardForm.FindComponent('_Label_' + IntToStr(CurPageID))).Font.Style := [fsBold];
            TLabel(WizardForm.FindComponent('_Label_' + IntToStr(CurPageID))).Font.Color := clBlack;
        end
            else
        begin
            TLabel(WizardForm.FindComponent('_Label_' + IntToStr(i))).Font.Style := [];
            TLabel(WizardForm.FindComponent('_Label_' + IntToStr(i))).Font.Color := clWhite;
        end;
    end;
    //
    with WizardForm do
    begin
        OuterNotebook.ActivePage.Color := clWhite;
        InnerNotebook.SetBounds(x div 30, y div 20, x - x div 15, y - y div 10);
        InnerNotebook.ActivePage.Color := clWhite;
        InfoBeforeMemo.Height := InnerNotebook.Height - InnerNotebook.Height div 8;
        DiskSpaceLabel.Top := InnerNotebook.Height - InnerNotebook.Height div 10;
        ComponentsList.Height := InnerNotebook.Height div 2;
        ComponentsDiskSpaceLabel.Top := InnerNotebook.Height - InnerNotebook.Height div 10;
        NoIconsCheck.Top := InnerNotebook.Height - InnerNotebook.Height div 10;
        TasksList.Height := InnerNotebook.Height - InnerNotebook.Height div 5;
        ReadyMemo.Height := InnerNotebook.Height - InnerNotebook.Height div 5;
        InfoAfterMemo.Height := InnerNotebook.Height - InnerNotebook.Height div 8;
    end;
end;


2all, как определить сколько страниц инсталлятора будет показано? Пробовал по-всякому, самый простой вариант - считать страницы по свойству Visible - не подходит, врет это свойство. Временно решил через препроцессор, обрабатывая текст скрипта на предмет директив, отключающих страницы, но считать нужно и кастомные страницы.
Это сообщение посчитали полезным следующие участники:

Отправлено: 13:33, 21-06-2011 | #2005