Inno Setup - replace default next/back/cancel buttons

后端 未结 1 1071
南方客
南方客 2021-01-06 13:30

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

相关标签:
1条回答
  • 2021-01-06 14:26

    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.

    0 讨论(0)
提交回复
热议问题