欢迎标签透明的Inno Setup的(Welcome Label Transparent on In

2019-06-27 02:08发布

我如何WelcomeLabel上Inno Setup的没有出现,只留下在图像中的文本。

这是我想要的。

Answer 1:

像这样的东西可能做的伎俩。 由于欢迎标签不支持透明度,需要用不同的类创建自己来解决这个(具有透明度的支持),继承父,字体,文本和大小,并隐藏原有的。 这里是脚本如何做到这一点:

[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;

而结果是:



Answer 2:

我怕你想可能是不可能或相当困难的,即使创建自定义页面。 看一看在CreateCustomPage()函数,以及您的Inno Setup的安装示例脚本。



Answer 3:

此代码可以帮助你。 只是改变了欢迎页面,但你可以在安装程序的其他页面尝试。

[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;


文章来源: Welcome Label Transparent on Inno Setup
标签: inno-setup