1

Image Banner on left

How can I add an image to the setup wizard, the bottom left?

Ken White
  • 123,280
  • 14
  • 225
  • 444
MendelG
  • 14,885
  • 4
  • 25
  • 52

1 Answers1

3

As @TLama commented: Create a TBitmapImage, set its parent to WizardForm, position it where you want and load the picture from file.

[Files]
Source: "logo.bmp"; Flags: dontcopy

[Code]

<event('InitializeWizard')>
procedure InitializeWizardAddLogo();
var
  Image: TBitmapImage;
begin
  Image := TBitmapImage.Create(WizardForm);
  with Image do
  begin
    Parent := WizardForm;
    ExtractTemporaryFile('logo.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\logo.bmp');
    AutoSize := True;
    AutoSize := False;
    Width := ScaleX(Width);
    Height := ScaleY(Height);
    Stretch := True;
    Left := ScaleX(10);
    Top :=
      (WizardForm.ClientHeight + WizardForm.Bevel.Top +
       WizardForm.Bevel.Height - Height)
      div 2;
  end;
end;

(the code [with event attribute] is for Inno Setup 6)

Though tricky part is to handle screen scaling correctly. Hence, the AutoSize trick and Scale* calls.

You even might need to have different versions of the logo for different scaling factors.
See Inno Setup WizardImageFile looks bad with font scaling on Windows 7


enter image description here

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