Inno Setup - replace default next/back/cancel butt

2019-02-15 17:44发布

I need a way to add my own buttons to wizard pages/remove existing ones in Inno Setup. Is that possible?

1条回答
趁早两清
2楼-- · 2019-02-15 17:52

Yes, it is possible:

[code]
procedure AboutButtonOnClick(Sender: TObject);
begin
  MsgBox('This is a demo of how to create a button!', mbInformation, mb_Ok);
end;

procedure CreateAboutButton(ParentForm: TSetupForm; CancelButton: TNewButton);
var
  AboutButton: TNewButton;
begin
  AboutButton := TNewButton.Create(ParentForm);
  AboutButton.Left := ParentForm.ClientWidth - CancelButton.Left - CancelButton.Width;
  AboutButton.Top := CancelButton.Top;
  AboutButton.Width := CancelButton.Width;
  AboutButton.Height := CancelButton.Height;
  AboutButton.Caption := '&About...';
  AboutButton.OnClick := @AboutButtonOnClick;
  AboutButton.Parent := ParentForm;
end;


procedure InitializeWizard();
begin
  CreateAboutButton(WizardForm, WizardForm.CancelButton);
end;

For more examples, take a look at the CodeClasses.iss example script in \program files\inno setup 5\examples.

查看更多
登录 后发表回答