Angel Montes de Oca
Angel Montes de Oca

Reputation: 1130

Show background behind controls on custom page of Inno Setup

I've created an installer, and I'm trying to set an image for the background. But the background does not show behind the text and progress bar controls on installation page, here is how it looks:

InstallTypePage InstallingPage

And this is the code I use to set background:

ExtractTemporaryFile('white.bmp');

InstallTypePage := CreateInputOptionPage(wpSelectDir,
  '', '',
  'Si eliges la instalación de tipo "Servidor" se creará una base de datos en blanco.',
  True, False);
{add white background}
BackImageW := TBitmapImage.Create(WizardForm);
BackImageW.Bitmap.LoadFromFile(ExpandConstant('{tmp}\white.bmp'));
BackImageW.Top := 0;
BackImageW.Left := 0; 
BackImageW.Parent := InstallTypePage.Surface;
BackImageW.Align := alCLient; 
BackImageW.Stretch := False;

{create radio buttons on page}
InstallTypePageID := InstallTypePage.ID;
InstallTypePage.Add('Servidor');
InstallTypePage.Add('Terminal');
InstallTypePage.Add('Restablecer');

BackImageW := TBitmapImage.Create(WizardForm);
BackImageW.Bitmap.LoadFromFile(ExpandConstant('{tmp}\white.bmp'));
BackImageW.Top := 0;
BackImageW.Left := 0;
BackImageW.Parent := WizardForm.InstallingPage;
BackImageW.Align := alCLient;
BackImageW.Stretch := False;
WizardForm.ProgressGauge.Top := WizardForm.InstallingPage.Height - ScaleY(40);
WizardForm.ProgressGauge.Height := ScaleY(8);

Upvotes: 1

Views: 850

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202128

TNewStaticText does not support transparency. You can fix that by replacing it with TLabel. See Inno Setup - Transparency under text in page name and description labels.

But your problem is not only TNewStaticText, but also TNewCheckListBox and other controls. And TNewCheckListBox does not support transparency at all. See Transparent components list background in Inno Setup? All you can do is to set its background to white. And if you decide to rely on this approach anyway, you can do the same with TNewStaticText and all other controls.

InstallTypePage.SubCaptionLabel.Color := clWhite;
InstallTypePage.CheckListBox.Color := clWhite;

enter image description here


You cannot change a color of TNewProgressBar though. You would have to draw a custom progress bar. See How do I change the color of my progress bar in Inno Setup?


There are clones of Inno Setup with themeing support. Those may support transparency of these controls.

Upvotes: 2

Related Questions