gpt4 book ai didi

inno-setup - Inno Setup 自定义页面

转载 作者:行者123 更新时间:2023-12-04 15:04:18 32 4
gpt4 key购买 nike

我想在您选择安装位置的页面之后创建一个自定义向导页面。

我已经在 InitializeWizard 中看到了如何创建自定义页面并将它们添加到向导中。程序。

我的问题是,当我创建自定义页面时,安装位置选择的默认页面不再出现。

我有哪些选项可以保留默认页面(安装位置选择)并添加我的新自定义页面?

谢谢

我的代码看起来像这样(由 inno 提供的 CodeClasses.iss 示例):

procedure CreateTheWizardPages;
var
Page: TWizardPage;
Button, FormButton: TButton;
CheckBox: TCheckBox;
Edit: TEdit;
PasswordEdit: TPasswordEdit;
Memo: TMemo;
Lbl, ProgressBarLabel: TLabel;
ComboBox: TComboBox;
ListBox: TListBox;
StaticText: TNewStaticText;
ProgressBar: TNewProgressBar;
CheckListBox, CheckListBox2: TNewCheckListBox;
FolderTreeView: TFolderTreeView;
BitmapImage, BitmapImage2, BitmapImage3: TBitmapImage;
BitmapFileName: String;
RichEditViewer: TRichEditViewer;
begin
{ TButton and others }

Page := CreateCustomPage(wpWelcome, 'Custom wizard page controls', 'TButton and others');

Button := TButton.Create(Page);
Button.Width := ScaleX(75);
Button.Height := ScaleY(23);
Button.Caption := 'TButton';
Button.OnClick := @ButtonOnClick;
Button.Parent := Page.Surface;

CheckBox := TCheckBox.Create(Page);
CheckBox.Top := Button.Top + Button.Height + ScaleY(8);
CheckBox.Width := Page.SurfaceWidth;
CheckBox.Height := ScaleY(17);
CheckBox.Caption := 'TCheckBox';
CheckBox.Checked := True;
CheckBox.Parent := Page.Surface;

Edit := TEdit.Create(Page);
Edit.Top := CheckBox.Top + CheckBox.Height + ScaleY(8);
Edit.Width := Page.SurfaceWidth div 2 - ScaleX(8);
Edit.Text := 'TEdit';
Edit.Parent := Page.Surface;

PasswordEdit := TPasswordEdit.Create(Page);
PasswordEdit.Left := Page.SurfaceWidth - Edit.Width;
PasswordEdit.Top := CheckBox.Top + CheckBox.Height + ScaleY(8);
PasswordEdit.Width := Edit.Width;
PasswordEdit.Text := 'TPasswordEdit';
PasswordEdit.Parent := Page.Surface;

Memo := TMemo.Create(Page);
Memo.Top := Edit.Top + Edit.Height + ScaleY(8);
Memo.Width := Page.SurfaceWidth;
Memo.Height := ScaleY(89);
Memo.ScrollBars := ssVertical;
Memo.Text := 'TMemo';
Memo.Parent := Page.Surface;

Lbl := TLabel.Create(Page);
Lbl.Top := Memo.Top + Memo.Height + ScaleY(8);
Lbl.Caption := 'TLabel';
Lbl.AutoSize := True;
Lbl.Parent := Page.Surface;

FormButton := TButton.Create(Page);
FormButton.Top := Lbl.Top + Lbl.Height + ScaleY(8);
FormButton.Width := ScaleX(75);
FormButton.Height := ScaleY(23);
FormButton.Caption := 'TSetupForm';
FormButton.OnClick := @FormButtonOnClick;
FormButton.Parent := Page.Surface;

......
procedure InitializeWizard();
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText: TNewStaticText;
begin
{ Custom wizard pages }

CreateTheWizardPages;

{ Other custom controls }

CancelButton := WizardForm.CancelButton;

AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.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 := WizardForm;

URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Caption := 'www.innosetup.com';
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);

BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Left := 50;
BackgroundBitmapImage.Top := 90;
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
BackgroundBitmapImage.Parent := MainForm;

BackgroundBitmapText := TNewStaticText.Create(MainForm);
BackgroundBitmapText.Left := BackgroundBitmapImage.Left;
BackgroundBitmapText.Top := BackgroundBitmapImage.Top + BackgroundBitmapImage.Height + ScaleY(8);
BackgroundBitmapText.Caption := 'TBitmapImage';
BackgroundBitmapText.Parent := MainForm;
end;

最佳答案

第一个参数 wpWelcome在这种情况下,指定在女巫页面之后显示我们的自定义页面。

Page := CreateCustomPage(wpWelcome, 'Custom wizard page controls', 'TButton and others');

关于inno-setup - Inno Setup 自定义页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4311995/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com