如何在Inno Setup中创建新的About按钮? [英] How to create new About button in Inno Setup?

查看:229
本文介绍了如何在Inno Setup中创建新的About按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在所有页面的左下角创建一个新的关于"按钮,例如wpWelcomewpSelectTaskswpInstalling等; 如果单击它将显示一些消息.如果用户按确定",则消息应关闭.该按钮应显示完整的单词关于",而不是"Abou ..." 我已经在Inno Setup中检查了CodeClasses.iss文件,但无法理解应该复制哪段代码.

I want to create a new About button at the bottom left corner of all the pages like wpWelcome, wpSelectTasks, wpInstalling etc; that will show some message if it is clicked. Message should close if user presses "OK". The button should show the full word "About" not like "Abou..." I have checked CodeClasses.iss file in Inno Setup, but I could not understand which piece of code I should copy, which should not.

我已经看过这两篇文章:

I have already seen these two post:

  • Adding a help button to an InnoSetup wizard page
  • INNO Setup: "About" button position

但是它们不是我真正想要的.

But they are not what I exactly want.

所以请任何人帮助.

推荐答案

以下是完成您所需要的操作的最小代码的简化内联版本:

Here is a simplified, inlined version of the minimum code necessary to do what you've asked for:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Code]
procedure AboutButtonOnClick(Sender: TObject);
begin
  MsgBox('This is the about message!', mbInformation, mb_Ok);
end;

procedure InitializeWizard;
var
  AboutButton: TNewButton;
begin
  { create an instance of the button and assign it to the local variable AboutButton }
  AboutButton := TNewButton.Create(WizardForm);
  { set the parent to the just created button control }
  AboutButton.Parent := WizardForm;
  { adjust the position to the created button control; it gets the horizontal indent }
  { by the right indent of the Cancel button; the vertical position as well as width }
  { and height are the same as the Cancel button has }
  AboutButton.Left := WizardForm.ClientWidth - WizardForm.CancelButton.Left -
    WizardForm.CancelButton.Width;
  AboutButton.Top := WizardForm.CancelButton.Top;
  AboutButton.Width := WizardForm.CancelButton.Width;
  AboutButton.Height := WizardForm.CancelButton.Height;
  { set its caption }
  AboutButton.Caption := '&About';
  { and assign the AboutButtonOnClick method to the OnClick event of the button }
  AboutButton.OnClick := @AboutButtonOnClick;
end;

这篇关于如何在Inno Setup中创建新的About按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆