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

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

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

Ветеран


Contributor


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

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


Цитата Юрій_Окропірідзе@vk:
Подскажите пожалуйста как изменить размер окна инсталлятора »
Вот процедура, в параметрах указываем относительные/абсолютные размеры.
Скрытый текст

Код: Выделить весь код
[Setup]
AppName=test
AppVerName=test
DefaultDirName={tmp}
CreateAppDir=no
Uninstallable=no
CreateUninstallRegKey=no

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

[CustomMessages]
ru.WizardDeltaWidthInvalid=Прирост формы по ширине должен быть в диапазоне от %1 до %2
ru.WizardDeltaHeightInvalid=Прирост формы по высоте должен быть в диапазоне от %1 до %2
ru.WizardWidthInvalid=Ширина формы должна быть в диапазоне от 0 до %1
ru.WizardHeightInvalid=Высота формы должна быть в диапазоне от 0 до %1

[code]
#define A = (Defined UNICODE) ? "W" : "A"
const
    SPI_GETWORKAREA = $0030;

// Large Integer Functions
function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer; external 'MulDiv@kernel32.dll stdcall';
// Configuration Reference
function SystemParametersInfo(uiAction, uiParam: UINT; var pvParam: TRect; fWinIni: UINT): BOOL; external 'SystemParametersInfo{#A}@user32.dll stdcall';

////////////////////////////////////////////////////////////////////////////
procedure RecreateWizardForm(const cx, cy: Longint; const IsDelta: Boolean);
// IsDelta : True - cx, cy is delta width/height, False - cx, cy is width/height
// cx......: delta width / width
// cy......: delta height / height
var
    rt: TRect;
    dx, dy: Longint;
begin
    { get deltas }
    if not IsDelta then
    begin
        cx := cx - WizardForm.Width;
        cy := cy - WizardForm.Height;
    end;

    { check deltas }
    if SystemParametersInfo(SPI_GETWORKAREA, 0, rt, 0) then
    begin
        { check delta width }
        if (cx < -WizardForm.Width) or (cx > rt.Right - WizardForm.Width) then
        begin
            if IsDelta then
                MsgBox(FmtMessage(CustomMessage('WizardDeltaWidthInvalid'), [IntToStr(-WizardForm.Width), IntToStr(rt.Right - WizardForm.Width)]), mbError, MB_OK)
            else
                MsgBox(FmtMessage(CustomMessage('WizardWidthInvalid'), [IntToStr(rt.Right)]), mbError, MB_OK);
            Exit;
        end;

        { check delta height }
        if (cy < -WizardForm.Height) or (cy > rt.Bottom - WizardForm.Height) then
        begin
            if IsDelta then
                MsgBox(FmtMessage(CustomMessage('WizardDeltaHeightInvalid'), [IntToStr(-WizardForm.Height), IntToStr(rt.Bottom - WizardForm.Height)]), mbError, MB_OK)
            else
                MsgBox(FmtMessage(CustomMessage('WizardHeightInvalid'), [IntToStr(rt.Bottom)]), mbError, MB_OK);
            Exit;
        end;
    end;

    { WizardForm }
    with WizardForm do
    begin
        { WizardForm }
        Width := Width + cx;
        Height := Height + cy;

        { buttons }
        CancelButton.Left := CancelButton.Left + cx;
        CancelButton.Top := CancelButton.Top + cy;
        NextButton.Left := NextButton.Left + cx;
        NextButton.Top := NextButton.Top + cy;
        BackButton.Left := BackButton.Left + cx;
        BackButton.Top := BackButton.Top + cy;

        { common }
        OuterNotebook.ClientWidth := ClientWidth;
        OuterNotebook.ClientHeight := OuterNotebook.ClientHeight + cy;
        InnerNotebook.Width := InnerNotebook.Width + cx;
        InnerNotebook.Height := InnerNotebook.Height + cy;
        MainPanel.ClientWidth := ClientWidth;
        WizardSmallBitmapImage.Left := WizardSmallBitmapImage.Left + cx;
        PageNameLabel.Width := PageNameLabel.Width + cx;
        PageDescriptionLabel.Width := PageDescriptionLabel.Width + cx;
        Bevel1.Width := Bevel1.Width + cx;
        Bevel.Width := Bevel.Width + cx;
        Bevel.Top := Bevel.Top + cy;
        BeveledLabel.Top := BeveledLabel.Top + cy;

        { wpWelcome }
        dx := MulDiv(cy, WizardBitmapImage.Width, WizardBitmapImage.Height);
        WizardBitmapImage.Width := WizardBitmapImage.Width + dx;
        WizardBitmapImage.Height := WizardBitmapImage.Height + cy;
        WelcomeLabel1.Left := WelcomeLabel1.Left + dx;
        WelcomeLabel1.Width := WelcomeLabel1.Width + cx - dx;
        dy := WelcomeLabel1.Height;
        WelcomeLabel1.AdjustHeight;
        dy := WelcomeLabel1.Height - dy;
        WelcomeLabel2.Top := WelcomeLabel2.Top + dy;
        WelcomeLabel2.Left := WelcomeLabel2.Left + dx;
        WelcomeLabel2.Width := WelcomeLabel2.Width + cx - dx;
        WelcomeLabel2.AdjustHeight;

        { wpLicense }
        LicenseLabel1.Width := LicenseLabel1.Width + cx;
        dy := LicenseLabel1.Height;
        LicenseLabel1.AdjustHeight;
        dy := LicenseLabel1.Height - dy;
        LicenseMemo.Top := LicenseMemo.Top + dy;
        LicenseMemo.Width := LicenseMemo.Width + cx;
        LicenseMemo.Height := LicenseMemo.Height + cy - dy;
        LicenseAcceptedRadio.Top := LicenseAcceptedRadio.Top + cy;
        LicenseAcceptedRadio.Width := LicenseAcceptedRadio.Width + cx;
        LicenseNotAcceptedRadio.Top := LicenseNotAcceptedRadio.Top + cy;
        LicenseNotAcceptedRadio.Width := LicenseNotAcceptedRadio.Width + cx;

        { wpPassword }
        PasswordLabel.Width := PasswordLabel.Width + cx;
        dy := PasswordLabel.Height;
        PasswordLabel.AdjustHeight;
        dy := PasswordLabel.Height - dy;
        PasswordEditLabel.Top := PasswordEditLabel.Top + dy;
        PasswordEditLabel.Width := PasswordEditLabel.Width + cx;
        PasswordEdit.Top := PasswordEdit.Top + dy;
        PasswordEdit.Width := PasswordEdit.Width + cx;

        { wpInfoBefore }
        InfoBeforeClickLabel.Width := InfoBeforeClickLabel.Width + cx;
        dy := InfoBeforeClickLabel.Height;
        InfoBeforeClickLabel.AdjustHeight;
        dy := InfoBeforeClickLabel.Height - dy;
        InfoBeforeMemo.Top := InfoBeforeMemo.Top + dy;
        InfoBeforeMemo.Width := InfoBeforeMemo.Width + cx;
        InfoBeforeMemo.Height := InfoBeforeMemo.Height + cy - dy;

        { wpUserInfo }
        UserInfoNameLabel.Width := UserInfoNameLabel.Width + cx;
        UserInfoNameEdit.Width := UserInfoNameEdit.Width + cx;
        UserInfoOrgLabel.Width := UserInfoOrgLabel.Width + cx;
        UserInfoOrgEdit.Width := UserInfoOrgEdit.Width + cx;
        UserInfoSerialLabel.Width := UserInfoSerialLabel.Width + cx;
        UserInfoSerialEdit.Width := UserInfoSerialEdit.Width + cx;

        { wpSelectDir }
        SelectDirLabel.Width := SelectDirLabel.Width + cx;
        SelectDirLabel.AdjustHeight;
        SelectDirBrowseLabel.Width := SelectDirBrowseLabel.Width + cx;
        dy := SelectDirBrowseLabel.Height;
        SelectDirBrowseLabel.AdjustHeight;
        dy := SelectDirBrowseLabel.Height - dy;
        DirEdit.Top := DirEdit.Top + dy;
        DirEdit.Width := DirEdit.Width + cx;
        DirBrowseButton.Top := DirBrowseButton.Top + dy;
        DirBrowseButton.Left := DirBrowseButton.Left + cx;
        DiskSpaceLabel.Width := DiskSpaceLabel.Width + cx;
        dy := DiskSpaceLabel.Height;
        DiskSpaceLabel.AdjustHeight;
        dy := DiskSpaceLabel.Height - dy;
        DiskSpaceLabel.Top := DiskSpaceLabel.Top + cy - dy;

        { wpSelectComponents }
        SelectComponentsLabel.Width := SelectComponentsLabel.Width + cx;
        dy := SelectComponentsLabel.Height;
        SelectComponentsLabel.AdjustHeight;
        dy := SelectComponentsLabel.Height - dy;
        TypesCombo.Top := TypesCombo.Top + dy;
        TypesCombo.Width := TypesCombo.Width + cx;
        ComponentsList.Top := ComponentsList.Top + dy;
        ComponentsList.Width := ComponentsList.Width + cx;
        ComponentsList.Height := ComponentsList.Height + cy - dy;
        ComponentsDiskSpaceLabel.Width := ComponentsDiskSpaceLabel.Width + cx;
        dy := ComponentsDiskSpaceLabel.Height;
        ComponentsDiskSpaceLabel.AdjustHeight;
        dy := ComponentsDiskSpaceLabel.Height - dy;
        ComponentsDiskSpaceLabel.Top := ComponentsDiskSpaceLabel.Top + cy - dy;

        { wpSelectProgramGroup }
        SelectStartMenuFolderLabel.Width := SelectStartMenuFolderLabel.Width + cx;
        SelectStartMenuFolderLabel.AdjustHeight;
        SelectStartMenuFolderBrowseLabel.Width := SelectStartMenuFolderBrowseLabel.Width + cx;
        dy := SelectStartMenuFolderBrowseLabel.Height;
        SelectStartMenuFolderBrowseLabel.AdjustHeight;
        dy := SelectStartMenuFolderBrowseLabel.Height - dy;
        GroupEdit.Top := GroupEdit.Top + dy;
        GroupEdit.Width := GroupEdit.Width + cx;
        GroupBrowseButton.Top := GroupBrowseButton.Top + dy;
        GroupBrowseButton.Left := GroupBrowseButton.Left + cx;
        NoIconsCheck.Top := NoIconsCheck.Top + cy;
        NoIconsCheck.Width := NoIconsCheck.Width + cx;

        { wpSelectTasks }
        SelectTasksLabel.Width := SelectTasksLabel.Width + cx;
        dy := SelectTasksLabel.Height;
        SelectTasksLabel.AdjustHeight;
        dy := SelectTasksLabel.Height - dy;
        TasksList.Top := TasksList.Top + dy;
        TasksList.Width := TasksList.Width + cx;
        TasksList.Height := TasksList.Height + cy - dy;

        { wpReady }
        ReadyLabel.Width := ReadyLabel.Width + cx;
        dy := ReadyLabel.Height;
        ReadyLabel.AdjustHeight;
        dy := ReadyLabel.Height - dy;
        ReadyMemo.Top := ReadyMemo.Top + dy;
        ReadyMemo.Width := ReadyMemo.Width + cx;
        ReadyMemo.Height := ReadyMemo.Height + cy - dy;

        { wpPreparing }
        PreparingLabel.Width := PreparingLabel.Width + cx;
        PreparingMemo.Width := PreparingMemo.Width + cx;
        PreparingMemo.Height := PreparingMemo.Height + cy;

        { wpInstalling }
        StatusLabel.Width := StatusLabel.Width + cx;
        FilenameLabel.Width := FilenameLabel.Width + cx;
        ProgressGauge.Width := ProgressGauge.Width + cx;

        { wpInfoAfter }
        InfoAfterClickLabel.Width := InfoAfterClickLabel.Width + cx;
        dy := InfoAfterClickLabel.Height;
        InfoAfterClickLabel.AdjustHeight;
        dy := InfoAfterClickLabel.Height - dy;
        InfoAfterMemo.Top := InfoAfterMemo.Top + dy;
        InfoAfterMemo.Width := InfoAfterMemo.Width + cx;
        InfoAfterMemo.Height := InfoAfterMemo.Height + cy - dy;

        { wpFinished }
        WizardBitmapImage2.Width := WizardBitmapImage2.Width + dx;
        WizardBitmapImage2.Height := WizardBitmapImage2.Height + cy;
        FinishedHeadingLabel.Left := FinishedHeadingLabel.Left + dx;
        FinishedHeadingLabel.Width := FinishedHeadingLabel.Width + cx - dx;
        dy := FinishedHeadingLabel.Height;
        FinishedHeadingLabel.AdjustHeight;
        dy := FinishedHeadingLabel.Height - dy;
        FinishedLabel.Top := FinishedLabel.Top + dy;
        FinishedLabel.Left := FinishedLabel.Left + dx;
        FinishedLabel.Width := FinishedLabel.Width + cx - dx;
        FinishedLabel.AdjustHeight;
        RunList.Left := RunList.Left + dx;
        RunList.Width := RunList.Width + cx - dx;
        dy := RunList.Top;
        RunList.Top := FinishedPage.Height - RunList.Height;
        dy := RunList.Top - dy;
        YesRadio.Top := YesRadio.Top + dy;
        YesRadio.Left := YesRadio.Left + dx;
        YesRadio.Width := YesRadio.Width + cx - dx;
        NoRadio.Top := NoRadio.Top + dy;
        NoRadio.Left := NoRadio.Left + dx;
        NoRadio.Width := NoRadio.Width + cx - dx;

        { new position }
        Center;
    end;
end;

///////////////////////////
procedure InitializeWizard;
begin
    RecreateWizardForm(150, 50, True);
end;
Это сообщение посчитали полезным следующие участники:

Отправлено: 10:22, 18-12-2014 | #2190