Greeting Shortcut Transparent at Inno Setup

How do I enable WelcomeLabel in Inno Setup and not leave only text above the image.

This is what I want.

enter image description here

+6
source share
3 answers

Something like this might do the trick. Since welcome labels do not support transparency, you need to deal with this by creating your own with another class (which has transparency support), inheriting the parent, font, text and size and hiding the original ones. Here's how to do it: script:

[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

+10
source

I am afraid that what you want may be impossible or quite difficult, even if you create a custom page. Take a look at CreateCustomPage () and the sample scripts included in the Inno Setup installation.

0
source

This code can help you. Just change the welcome page, but you can try with other installer pages.

 [code] function NextButtonClick(CurPageID: Integer): Boolean; begin Result := True; end; function GetCustomSetupExitCode(): Integer; begin Result := 1; end; procedure InitializeWizard(); var WLabel1, WLabel2, FLabel1, FLabel2: TLabel; begin WizardForm.WelcomeLabel1.Hide; WizardForm.WelcomeLabel2.Hide; WizardForm.FinishedHeadingLabel.Hide; WizardForm.FinishedLabel.Hide; WizardForm.WizardBitmapImage.Width := 500; WizardForm.WizardBitmapImage.Height := 315; WLabel1 := TLabel.Create(WizardForm); WLabel1.Left := ScaleX(176); WLabel1.Top := ScaleY(16); WLabel1.Width := ScaleX(301); WLabel1.Height := ScaleY(54); WLabel1.AutoSize := False; WLabel1.WordWrap := True; WLabel1.Font.Name := 'verdana'; WLabel1.Font.Size := 12; WLabel1.Font.Style := [fsBold]; WLabel1.Font.Color:= clBlack; WLabel1.ShowAccelChar := False; WLabel1.Caption := WizardForm.WelcomeLabel1.Caption; WLabel1.Transparent := True; WLabel1.Parent := WizardForm.WelcomePage; WLabel2 :=TLabel.Create(WizardForm); WLabel2.Top := ScaleY(76); WLabel2.Left := ScaleX(176); WLabel2.Width := ScaleX(301); WLabel2.Height := ScaleY(234); WLabel2.AutoSize := False; WLabel2.WordWrap := True; WLabel2.Font.Name := 'tahoma'; WLabel2.Font.Color:= clBlack; WLabel2.ShowAccelChar := False; WLabel2.Caption := WizardForm.WelcomeLabel2.Caption; WLabel2.Transparent := True; WLabel2.Parent := WizardForm.WelcomePage; WizardForm.WizardBitmapImage2.Width := 500; WizardForm.WizardBitmapImage2.Height := 315; FLabel1 := TLabel.Create(WizardForm); FLabel1.Left := ScaleX(176); FLabel1.Top := ScaleY(16); FLabel1.Width := ScaleX(301); FLabel1.Height := ScaleY(54); FLabel1.AutoSize := False; FLabel1.WordWrap := True; FLabel1.Font.Name := 'verdana'; FLabel1.Font.Size := 12; FLabel1.Font.Style := [fsBold]; FLabel1.Font.Color:= clBlack; FLabel1.ShowAccelChar := False; FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption; FLabel1.Transparent := True; FLabel1.Parent := WizardForm.FinishedPage; FLabel2 :=TLabel.Create(WizardForm); FLabel2.Top := ScaleY(76); FLabel2.Left := ScaleX(176); FLabel2.Width := ScaleX(301); FLabel2.Height := ScaleY(53); FLabel2.AutoSize := False; FLabel2.WordWrap := True; FLabel2.Font.Name := 'tahoma'; FLabel2.Font.Color:= clBlack; FLabel2.ShowAccelChar := False; FLabel2.Caption := WizardForm.FinishedLabel.Caption; FLabel2.Transparent := True; FLabel2.Parent := WizardForm.FinishedPage; end; 
0
source

Source: https://habr.com/ru/post/922895/


All Articles