Inno设置 - 替换默认的下一个/后退/取消按钮

时间:2011-02-01 21:37:28

标签: button installer inno-setup

我需要一种方法将自己的按钮添加到向导页面/删除Inno Setup中的现有按钮。那可能吗?

1 个答案:

答案 0 :(得分:11)

是的,有可能:

[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;

有关更多示例,请查看\ program files \ inno setup 5 \ examples中的CodeClasses.iss示例脚本。