Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup - replace default next/back/cancel buttons

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

like image 504
SharpAffair Avatar asked Apr 15 '26 10:04

SharpAffair


1 Answers

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.

like image 137
jachguate Avatar answered Apr 20 '26 03:04

jachguate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!