Google
      
发新话题
打印

InnoSetup脚本代码的一点儿技巧[个性设置]

InnoSetup脚本代码的一点儿技巧[个性设置]

[转帖]
1、显示红框1(也就是“Inno Installer 5.x”),在脚本代码最后输入 引用:
[Messages]
BeveledLabel=Inno Installer 5.x

红色字可以替换为你想要的文字(比如程序名称)

2、显示红框2和红框3(也就是“About”和网址) 引用:
[Code]
procedure AboutButtonOnClick(Sender: TObject);
begin
  MsgBox('这个演示显示一些向导窗体对象和各种 VCL 类的功能。', mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'http://www.innosetup.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
var
  AboutButton, CancelButton: TButton;
  URLLabel: TNewStaticText;
  BackgroundBitmapImage: TBitmapImage;
  BackgroundBitmapText: TNewStaticText;
begin
  CancelButton := WizardForm.CancelButton;

  AboutButton := TButton.Create(WizardForm);
  AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
  AboutButton.Top := CancelButton.Top;
  AboutButton.Width := CancelButton.Width;
  AboutButton.Height := CancelButton.Height;
  AboutButton.Caption := '关于(&A)...';
  AboutButton.OnClick := @AboutButtonOnClick;
  AboutButton.Parent := WizardForm;
  
  URLLabel := TNewStaticText.Create(WizardForm);
  URLLabel.Caption := 'www.innosetup.com';
  URLLabel.Cursor := crHand;
  URLLabel.OnClick := @URLLabelOnClick;
  URLLabel.Parent := WizardForm;
  { Alter Font *after* setting Parent so the correct defaults are inherited first }
  URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
  URLLabel.Font.Color := clBlue;
  URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
  URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
end;

OK!替换红色的就可以了!

简要解释 引用:
[Code]
procedure AboutButtonOnClick(Sender: TObject);            //当关于键被按下时产生的行为
begin
MsgBox(#13 '梦想吧(似水年华) 制作'#13#13 'Copyright (C) 2006 WWW.DREAMS8.COM', mbInformation, MB_OK);
end;

procedure URLLabelOnClick(Sender: TObject);                   ////当URL键被按下时产生的行为
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.dreams8.com.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard();
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;          //建立一个url的按钮


begin
//窗体文本颜色------------------------------------------
WizardForm.PAGENAMELABEL.Font.Color:= clRed;
WizardForm.PAGEDESCRIPTIONLABEL.Font.Color:= clBlack;
WizardForm.WELCOMELABEL1.Font.Color:= clBlack;
WizardForm.WELCOMELABEL2.Font.Color:= clOlive;
{ 其它自定义控制 }

CancelButton := WizardForm.CancelButton;

AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
AboutButton.Top := CancelButton.Top - 0;     //按扭在窗体上的位置
//按扭宽/高
AboutButton.Width := ScaleX(60);
AboutButton.Height := ScaleY(22);
AboutButton.Caption := '关于(&A)';          //按扭标题
AboutButton.OnClick := @AboutButtonOnClick;     //事件激活
AboutButton.Parent := WizardForm;

//添加一个Labe标签-----------------------------------------------------------------------
URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Caption := '访问 梦想吧|DREAMS8';
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clRed;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
end;


附件 inno_t.gif (1.88 KB) 2007-1-28 07:43 PM
好不容易忙完,现在总算有点时间了。不能及时回答大家的问题,还请大家多多包函。
勇于思考,敢于行动,不逃避问题。
业务联系:dvd制作,各种系统、平面广告设计、3D设计,电脑专业维修,网络组建,MTV个人像册、视频处理!
电话:13423195467

TOP

发新话题