如何在进度页面上显示自定义文本消息?

时间:2014-03-21 06:14:02

标签: inno-setup

如何在InnoSetup的进度页面上显示自定义文本区域?

在下面的图片中,我标记了我想用一些文字填充的区域(如果进度条移动到底部并且文本区域将放在其上方,则不会介意):

必须在欢迎页面上添加自定义消息!(第一页) - (黑色圆圈区域)

enter image description here

1 个答案:

答案 0 :(得分:6)

安装页面示例:

[CustomMessages]
CustomMessage=This is my custom message! Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

[Code]
procedure CurPageChanged(CurPageID: Integer);
var
InstallMessage: TLabel;
begin
  if CurPageID = wpInstalling then begin
    InstallMessage:= TLabel.Create(WizardForm);
    InstallMessage.AutoSize:= False;
    InstallMessage.Top := WizardForm.ProgressGauge.Top + 
     WizardForm.ProgressGauge.Height + ScaleY(8);
    InstallMessage.Height := ScaleY(150);
    InstallMessage.Left := WizardForm.ProgressGauge.Left + ScaleX(0);
    InstallMessage.Width := ScaleX(417);
    InstallMessage.Font:= WizardForm.FilenameLabel.Font;
    InstallMessage.Font.Color:= clBlack;
    InstallMessage.Font.Height:= ScaleY(15);
    InstallMessage.Transparent:= True;
    InstallMessage.WordWrap:= true;
    InstallMessage.Caption:= (ExpandConstant('{cm:CustomMessage}'));
    InstallMessage.Parent:= WizardForm.InstallingPage; 
  end;
end;

准备安装页面示例(简单覆盖):

[Messages] 
ReadyLabel2a=Your Custom Ready Label 2a Message. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
ReadyLabel2b=Your Custom Ready Label 2b Message. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

准备安装页面示例(自定义消息):

[CustomMessages]
CustomMessage=This is my custom message! Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

procedure CurPageChanged(CurPageID: Integer);
var
InstallMessage: TLabel;
begin
  if CurPageID = wpReady then begin
    InstallMessage:= TLabel.Create(WizardForm);
    InstallMessage.AutoSize:= False;
    InstallMessage.Top := WizardForm.ReadyLabel.Top + 
     WizardForm.ReadyLabel.Height + ScaleY(8);
    InstallMessage.Height := ScaleY(150);
    InstallMessage.Left := WizardForm.ReadyLabel.Left + ScaleX(0);
    InstallMessage.Width := ScaleX(417);
    InstallMessage.Font:= WizardForm.ReadyLabel.Font;
    InstallMessage.Font.Color:= clBlack;
    InstallMessage.Font.Height:= ScaleY(15);
    InstallMessage.Transparent:= True;
    InstallMessage.WordWrap:= true;
    InstallMessage.Caption:= (ExpandConstant('{cm:CustomMessage}'));
    InstallMessage.Parent:= WizardForm.ReadyPage; 
  end;
end;