Inno Setup 自定义页面

2024-02-10

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

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

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

我必须使用哪些选项来保留默认页面(安装位置选择)并添加新的自定义页面?

Thanks

我的代码看起来像这样( 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');
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Inno Setup 自定义页面 的相关文章

随机推荐

  • CouchDB - 创建或更新文档时触发代码

    我有一个在 CouchDB 中存储数据的页面 该页面直接通过 JavaScript 访问数据库 因此浏览器中没有隐藏太多逻辑 创建新文档时 有一些逻辑将数据元素提取到单独的字段中 以便可以搜索它们 创建或更新文档时是否可以在服务器上执行此逻
  • 如何使用 [object addGesture...] 从 C4Workspace 调用方法?

    我希望实现的是使用以下方法调用 C4Workspace m 中的方法 shape addGesture SWIPELEFT name swipeLeft action leftSwipeMethod 我知道这会尝试在 C4Shape 类中调
  • jQuery livequery 插件相当于 jQuery 1.7+

    是否有相当于 jQuery 1 7 的 jQuery livequery 插件 我正在尝试动态绑定事件 读取 DOM 元素应基于 data 元素绑定的事件 a href class js test Test 1 a a href class
  • 尽可能避免使用 mod 运算符是否更好?

    我认为计算数字的模是一个有点昂贵的操作 至少与简单的算术测试 例如查看数字是否超过数组的长度 相比 如果确实如此 那么替换例如以下代码是否会更有效 res array i 1 len 与以下 res array i 1 len 0 i 1
  • DMARC/SPF 配置错误

    我有一个注册域名domains google com我使用 G Suite 帐户并从 SES 和 mailchimp 发送电子邮件 我的 DNS 记录看起来正确 Mailchimp 说明 https kb mailchimp com acc
  • reCAPTCHA - 按提交后出现

    我想在我的表单中使用 reCAPTCHA 用户必须填写表格 然后按 提交 之后 在 提交 按钮下 应该会出现 reCAPTCHA 我怎样才能做到这一点 如果我想要这样的东西 我可能会将 reCAPTCHA 预加载到jQuery 对话框 ht
  • 不可点击的锚标记

    我使用这个html代码 div class titleIn h2 a href link2 link2 a h2 div 并且由于某种原因link2不可点击 没有手形光标 CSS 是 titleIn direction rtl margin
  • SublimeText3中的binary_file_patterns和index_exclude_patterns有什么区别?

    在 Sublime Text 3 中binary file patterns排除在文件或模糊搜索 转到任何内容 中找到的文件index exclude patterns防止文件被索引 既然我们知道无法找到未索引的文件 并且假设无法追踪的文件
  • 更改资源文件 (resx) 命名空间和访问修饰符

    在我的网络项目中 我使用了 4 个资源文件App GlobalResources文件夹 其中之一 lang resx 是在我到达该项目之前创建的 它具有正确的命名空间 WebApplication App GlobalResources 和
  • 在这种情况下,为什么不从参数推断出通用值 N ?

    这个问题 TypeScript 要求两个数组长度相同 https stackoverflow com questions 62206320 typescript require that two arrays be the same len
  • 将 pandas 数据框中的逗号分隔单元格拆分为不同的列[重复]

    这个问题在这里已经有答案了 如何将逗号分隔的字符串拆分为新列 预期产出 Source Target Weight 0 Majed Moqed Majed Moqed 0 尝试这个 df Source df Source Target Wei
  • XPath - 属性通配符不返回具有名为 value 的属性的元素

    我正在尝试使用 XPath Java 来获取基于以特定值开头的未知属性的所有未知节点 由于某种原因 它没有返回包含名为的属性的节点value 我也测试过www freeformatter com xpath tester html http
  • 及时均匀地对位置时间序列进行重新采样

    正如地球科学中经常发生的那样 我有一系列位置 经度 纬度 时间序列的时间间隔不均匀 时间采样如下 t diff every position 3 99 1 00 3 00 4 00 3 98 3 99 我将位置与每个 t 相关联 lat 7
  • 读取 Jpeg2000 元数据

    我想找到一个具有 BSD MIT 或同等 许可证的开源库 该库能够读取 XML 或任何 元数据 jp2文件 迄今为止的研究 OpenJpeg https github com uclouvain openjpeg不读取元数据 EasyExi
  • 通过递归使用 XElement 动态构建 Xml

    我是 linq to Xml 的新手 我有一个递归方法作为参数XElement root它应该以表示给定递归深度的相关子树根的方式保存 XML 数据 void recursiveMethod XElement root 更具体地说 还可以看
  • 为什么 Scala 集合中没有不可变的双链表?

    看着this https stackoverflow com q 8039261 770361问题 提问者对某个元素的第一个和最后一个实例感兴趣List 似乎更有效的解决方案是使用DoubleLinkedList可以从列表末尾向后搜索 然而
  • pycharm 代码完成不适用于 SimpleNamespace

    为什么 SimpleNamespace 代码补全在 pycharm 编辑器中不起作用 from types import SimpleNamespace sn SimpleNamespace param a 1 sn pressing do
  • EmberJS 路线事件转换

    emberjs 1 0 0 rc 6 1 我的控制器 Application LoginController Ember Controller extend loginFailed false isProcessing false isSl
  • SIFT匹配和识别?

    我正在开发一个应用程序 其中使用 SIFT RANSAC 和单应性来查找对象 OpenCV C Java 我面临的问题是 在有很多异常值的地方 RANSAC 表现不佳 为此我想尝试一下SIFT的作者说的很好的办法 投票 我读过我们应该在 4
  • Inno Setup 自定义页面

    我想在选择安装位置的页面之后创建一个自定义向导页面 我已经了解了如何创建自定义页面并将其添加到向导中InitializeWizard程序 我的问题是 当我创建自定义页面时 安装位置选择的默认页面不再出现 我必须使用哪些选项来保留默认页面 安