13

Inno Setup the setup wizard size is fixed, but I want to change wizard setup size and change a few items including image and ...

enter image description here

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
HoseinCS
  • 169
  • 1
  • 1
  • 7

3 Answers3

17

Inno Setup 6

Inno Setup 6 supports changing a size of the wizard window.

You can use WizardSizePercent to change a size of the wizard window.

You can also use WizardResizable to allow the user to resize the wizard (this is default behaviour, if you use the modern WizardStyle).


Inno Setup 5

There's no magic way to make the wizard pages larger in Inno Setup 5. They are designed for a specific size. If you want to make them larger, you have to go page-by-page, control-by-control and carefully decide how to layout them for your new size.

The following code is just an example, you may want to choose another change in layout.

procedure ShiftDown(Control: TControl; DeltaY: Integer);
begin
  Control.Top := Control.Top + DeltaY;
end;

procedure ShiftRight(Control: TControl; DeltaX: Integer);
begin
  Control.Left := Control.Left + DeltaX;
end;

procedure ShiftDownAndRight(Control: TControl; DeltaX, DeltaY: Integer);
begin
  ShiftDown(Control, DeltaY);
  ShiftRight(Control, DeltaX);
end;

procedure GrowDown(Control: TControl; DeltaY: Integer);
begin
  Control.Height := Control.Height + DeltaY;
end;

procedure GrowRight(Control: TControl; DeltaX: Integer);
begin
  Control.Width := Control.Width + DeltaX;
end;

procedure GrowRightAndDown(Control: TControl; DeltaX, DeltaY: Integer);
begin
  GrowRight(Control, DeltaX);
  GrowDown(Control, DeltaY);
end;

procedure GrowRightAndShiftDown(Control: TControl; DeltaX, DeltaY: Integer);
begin
  GrowRight(Control, DeltaX);
  ShiftDown(Control, DeltaY);
end;

procedure GrowWizard(DeltaX, DeltaY: Integer);
begin
  GrowRightAndDown(WizardForm, DeltaX, DeltaY);
  
  with WizardForm do
  begin
    GrowRightAndShiftDown(Bevel, DeltaX, DeltaY);
    ShiftDownAndRight(CancelButton, DeltaX, DeltaY);
    ShiftDownAndRight(NextButton, DeltaX, DeltaY);
    ShiftDownAndRight(BackButton, DeltaX, DeltaY);
    GrowRightAndDown(OuterNotebook, DeltaX, DeltaY);
    GrowRight(BeveledLabel, DeltaX);

    { WelcomePage }
    GrowDown(WizardBitmapImage, DeltaY);
    GrowRight(WelcomeLabel2, DeltaX);
    GrowRight(WelcomeLabel1, DeltaX);
    
    { InnerPage }
    GrowRight(Bevel1, DeltaX);
    GrowRightAndDown(InnerNotebook, DeltaX, DeltaY);
    
    { LicensePage }
    ShiftDown(LicenseNotAcceptedRadio, DeltaY);
    ShiftDown(LicenseAcceptedRadio, DeltaY);
    GrowRightAndDown(LicenseMemo, DeltaX, DeltaY);
    GrowRight(LicenseLabel1, DeltaX);
    
    { SelectDirPage }
    GrowRightAndShiftDown(DiskSpaceLabel, DeltaX, DeltaY);
    ShiftRight(DirBrowseButton, DeltaX);
    GrowRight(DirEdit, DeltaX);
    GrowRight(SelectDirBrowseLabel, DeltaX);
    GrowRight(SelectDirLabel, DeltaX);

    { SelectComponentsPage }
    GrowRightAndShiftDown(ComponentsDiskSpaceLabel, DeltaX, DeltaY);
    GrowRightAndDown(ComponentsList, DeltaX, DeltaY);
    GrowRight(TypesCombo, DeltaX);
    GrowRight(SelectComponentsLabel, DeltaX);
    
    { SelectTasksPage }
    GrowRightAndDown(TasksList, DeltaX, DeltaY);
    GrowRight(SelectTasksLabel, DeltaX);

    { ReadyPage }
    GrowRightAndDown(ReadyMemo, DeltaX, DeltaY);
    GrowRight(ReadyLabel, DeltaX);
    
    { InstallingPage }
    GrowRight(FilenameLabel, DeltaX);
    GrowRight(StatusLabel, DeltaX);
    GrowRight(ProgressGauge, DeltaX);

    { MainPanel }
    GrowRight(MainPanel, DeltaX);
    ShiftRight(WizardSmallBitmapImage, DeltaX);
    GrowRight(PageDescriptionLabel, DeltaX);
    GrowRight(PageNameLabel, DeltaX);
    
    { FinishedPage }
    GrowDown(WizardBitmapImage2, DeltaY);
    GrowRight(RunList, DeltaX);
    GrowRight(FinishedLabel, DeltaX);
    GrowRight(FinishedHeadingLabel, DeltaX);
  end;
end;

Use the GrowWizard function from the InitializeWizard event function (or elsewhere), giving it a change in width and height as parameters:

procedure InitializeWizard();
begin
  GrowWizard(ScaleX(100), ScaleY(80));
end;

The code takes care of the following pages:

  • WelcomePage

    WelcomePage

  • LicensePage

    LicensePage

  • SelectDirPage

    SelectDirPage

  • SelectComponentsPage

    SelectComponentsPage

  • SelectTasksPage

    SelectTasksPage

  • ReadyPage

    ReadyPage

  • InstallingPage

    InstallingPage

  • FinishedPage

    FinishedPage


Other, less common, pages are left as an exercise to the readers:

  • PasswordPage
  • InfoBeforePage (same as LicensePage)
  • UserInfoPage
  • SelectProgramGroupPage
  • PreparingPage
  • InfoAfterPage (same as LicensePage)

Similar questions:

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
2

I am updating this question with up-to-date answer:

Inno Setup 6 introduced many changes and one of them is the possibility to resize the wizard window, which is now standard feature of Inno Setup:

Resizable wizard window

The wizard window is now optionally resizable:

Added new [Setup] section directive: WizardResizable. If this directive is set to yes, the user will be able to resize the main Setup wizard window.
Added new [Setup] section directive: WizardSizePercent, which can be used to increase the default size of all Setup and Uninstall wizard windows without increasing the font size.
Pascal Scripting changes:
    Added new Anchors property to all controls and new KeepSizeY property to TSetupForm which allows you to add full support for WizardResizable and WizardSizePercent to all your custom controls, custom wizard pages and TSetupForm forms if you have any. See the CodeClasses.iss example script for an example. This example also shows other changes done to TSetupForm.
    Added new Constraints property to the TForm support class.

New modern wizard style

The wizard window now supports a more modern look:

Added new [Setup] section directive: WizardStyle. If this directive is set to modern, Setup and Uninstall will show a more modern look and also the defaults for WizardResizable and WizardSizePercent change to respectively yes and 120,120.
Change in default behavior: Earlier versions of Inno Setup also supported WizardStyle and if you still have WizardStyle=modern in your script (which was allowed for backward compatibility but didn't actually change anything) and don't want to new modern look, you should remove this line or change it to WizardStyle=classic.
Updated all examples and the Compiler IDE's New Script Wizard to use WizardStyle=modern.
Pascal Scripting change: Added new SurfaceColor property to the TWizardPage support class.

Now it is much easier to resize the wizard window without any special hacks or code.

Slappy
  • 5,250
  • 1
  • 23
  • 29
2

I strongly recommend to use NSIS instead of InnoSetup to create Windows installers.

It has all the flexibility that you are asking for, and much more:

  • NSIS is fully scriptable in any direction, I was able to implement every customization of the installer that I ever needed.
  • NSIS creates technically better installers: No mess of temporary files and multiple unpack stages.
  • As a result, the created installers are blazingly fast.
  • NSIS can be used to create the Windows installer in a cross-compiling setup, see e.g. the Debian nsis package.
  • That is, you can create a very good Windows installer without ever having to touch a Windows system. This is why it also became part of the Windows cross compiling toolchain MXE.

The only disadvantage of NSIS that I experienced so far is:

  • Its scripting language is a bit ad-hoc and needs some initial learning to get used to.
vog
  • 23,517
  • 11
  • 59
  • 75