对于喜欢玩 DIY 的同学来说肯定都希望自己的安装包能个性化,而 Inno Setup 就可以充分满足您的需求,只是相对来说Inno Setup在简易的向导模式中并不能很好的实现完全个性化自定义。当然,这里给大家提供的也是小编网络上收集并整理后的代码,如果您觉得有用,可以拿来使用。
Inno Setup 左下角自定义文本及提示效果:
Inno Setup 左下角自定义文本及提示代码:
- [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制作非常个性化的安装包效果。