当前位置: 首页 > 教程资源 > Inno Setup 教程 > 正文
如何为您的 Inno Setup 安装包左下角增加自定义文本及提示

如何为您的 Inno Setup 安装包左下角增加自定义文本及提示

作者:大眼仔~旭 日期:4年前 (2020-11-06) 评论:1 条

摘要:对于喜欢玩 DIY 的同学来说肯定都希望自己的安装包能个性化,而 Inno Setup 就可以充分满足您的需求,只是相对来说 Inno Setup 在简易的向导模式中并不能很好的实现完全个性化自定义。当然,这里给大家提供的也是大眼仔旭网络上收集并整理后的代码,如果您觉得有用,可以拿来使用。 Inno Setup 左下角…

对于喜欢玩 DIY 的同学来说肯定都希望自己的安装包能个性化,而 Inno Setup 就可以充分满足您的需求,只是相对来说 Inno Setup 在简易的向导模式中并不能很好的实现完全个性化自定义。当然,这里给大家提供的也是大眼仔旭网络上收集并整理后的代码,如果您觉得有用,可以拿来使用。

Inno Setup 左下角自定义文本及提示效果:

Inno Setup 安装包左下角增加自定义文本及提示

Inno Setup 安装包左下角增加自定义文本及提示

Inno Setup 左下角自定义文本及提示代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[Code]
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if PageID=wpReady then
result := true;
end;

procedure AboutButtonOnClick(Sender: TObject);
begin
  MsgBox('大眼仔~旭 分享(Anan)2020(www.dayanzai.me)', mbInformation, mb_Ok);
end;

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

procedure InitializeWizard();
var
  AboutButton, CancelButton: TButton;
  URLLabel: TNewStaticText;
begin
  WizardForm.FilenameLabel.Visible:= false;
  WizardForm.BorderIcons:= [biSystemMenu, biMinimize];
  WizardForm.BorderIcons:= [biHelp, biSystemMenu, biMinimize];
  WizardForm.LICENSEACCEPTEDRADIO.Checked:=true;
  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.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
  URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
  URLLabel.Caption := '大眼仔~旭';
  URLLabel.OnClick := @URLLabelOnClick;
  URLLabel.Parent := WizardForm;
  URLLabel.Font.Style := URLLabel.Font.Style;
  URLLabel.Cursor := crHand;
  URLLabel.Font.Color := clBlue;
end;

Inno Setup 是一款开源且免费的实用安装包制作工具,除了通过向导模式制作简单的安装包,您如果有代码功底可以很好的使用 Inno Setup 制作非常个性化的安装包效果。

声明:大眼仔旭 | 本文采用署名-非商业性使用-相同方式共享 4.0 国际许可协议[CC BY-NC-SA]进行授权
文章名称:《如何为您的 Inno Setup 安装包左下角增加自定义文本及提示
文章固定链接:http://www.dayanzai.me/inno-setup-tip.html
本站资源仅供个人学习交流,请于下载后 24 小时内删除,不允许用于商业用途,否则法律问题自行承担。
转载声明
全部评论: (1条)
  1. XMuli2023-10-14 21:57 回复
    实测在 Inno Setup 6.2.2 版本中,这两个按钮会错位(4K, 150% 缩放 Windows 10 22H2)

发表评论

返回顶部