inno-setup

Welcome Label Transparent on Inno Setup


How do I WelcomeLabel on Inno Setup does not appear and leave only the text over the image.

This is that i want.

enter image description here


Solution

  • Something like this might do the trick. Since the welcome labels don't support transparency, you need to workaround this by creating your own with a different class (that has a transparency support), inherit the parent, font, text and size and hide the original ones. Here is the script how to do this:

    [Code]
    procedure InheritBoundsRect(ASource, ATarget: TControl);
    begin
      ATarget.Left := ASource.Left;
      ATarget.Top := ASource.Top;
      ATarget.Width := ASource.Width;
      ATarget.Height := ASource.Height;
    end;
    
    procedure InitializeWizard;
    var
      TopWelcomeLabel: TLabel;
      BottomWelcomeLabel: TLabel;
    begin
      WizardForm.WizardBitmapImage.Align := alClient;
      WizardForm.WizardBitmapImage.Bitmap.LoadFromFile('D:\Image.bmp');
    
      TopWelcomeLabel := TLabel.Create(WizardForm);
      TopWelcomeLabel.Parent := WizardForm.WelcomeLabel1.Parent;
      TopWelcomeLabel.Font := WizardForm.WelcomeLabel1.Font;
      TopWelcomeLabel.Caption := WizardForm.WelcomeLabel1.Caption;
      TopWelcomeLabel.WordWrap := WizardForm.WelcomeLabel1.WordWrap;
      InheritBoundsRect(WizardForm.WelcomeLabel1, TopWelcomeLabel);
      WizardForm.WelcomeLabel1.Visible := False;
    
      BottomWelcomeLabel := TLabel.Create(WizardForm);
      BottomWelcomeLabel.Parent := WizardForm.WelcomeLabel2.Parent;
      BottomWelcomeLabel.Font := WizardForm.WelcomeLabel2.Font;
      BottomWelcomeLabel.Caption := WizardForm.WelcomeLabel2.Caption;
      BottomWelcomeLabel.WordWrap := WizardForm.WelcomeLabel2.WordWrap;
      InheritBoundsRect(WizardForm.WelcomeLabel2, BottomWelcomeLabel);
      WizardForm.WelcomeLabel2.Visible := False;
    end;
    

    And the result:

    enter image description here