Inno-setup:基于现有页面类型的自定义向导页面

发布于 2024-12-27 10:55:23 字数 103 浏览 5 评论 0原文

我决定在基于 inno-setup 的安装程序中创建自定义向导页面。但我不想从头开始创建它。我想采用 TInputDirWizardPage 并修改它,例如添加一个组合框。是否可以?怎么做呢?

I decided to create custom wizard page in my inno-setup-based installer. But i do not want to create it from scratch. I want to take TInputDirWizardPage and modify it, e.g. add a combo-box. Is it possible? How to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

×眷恋的温暖 2025-01-03 10:55:23

我自己想出来了。所以我会回答我自己的问题。示例代码如下:

[Code]
const DB_PAGE_CAPTION='Select Application Database Folder';
  DB_PAGE_DESCRIPTION='Where should application database files be installed or where     your database files already are?';
  DB_PAGE_SUBCAPTION='In case of new installation select the folder in which Setup should install application database files, then click Next. Or select folder where previous version of application stored database files, then click Next';

var databasePage : TInputDirWizardPage;//this is predefined form declaration
    CheckListBox : TNewCheckListBox;  //this is new element i'm about to add to page

procedure createDatabaseWizardPage; //creating page
begin
databasePage :=CreateInputDirPage(wpSelectDir,
DB_PAGE_CAPTION,
DB_PAGE_DESCRIPTION,
DB_PAGE_SUBCAPTION,
False, '');
databasePage.Add('');

databasePage.buttons[0].Top:=databasePage.buttons[0].Top+ScaleY(70);//moving predefined 
databasePage.edits[0].Top:=databasePage.edits[0].Top+ScaleY(70);    //elements down.
databasePage.edits[0].Text:=ExpandConstant('{commonappdata}\my app');//default value

CheckListBox := TNewCheckListBox.Create(databasePage);//creating and modifying new checklistbox
CheckListBox.Top := 40 + ScaleY(8);
CheckListBox.Width := databasePage.SurfaceWidth;
CheckListBox.Height := ScaleY(50);
CheckListBox.BorderStyle := bsNone;
CheckListBox.ParentColor := True;
CheckListBox.MinItemHeight := WizardForm.TasksList.MinItemHeight;
CheckListBox.ShowLines := False;
CheckListBox.WantTabs := True;
CheckListBox.Parent := databasePage.Surface;//setting control's parent element
CheckListBox.AddRadioButton('New Installation', '', 0, True, True, nil);
CheckListBox.AddRadioButton('Update existing copy', '', 0, False, True, nil);
end;


procedure InitializeWizard;
begin
createDatabaseWizardPage(); 
end;

谢谢大家! :-)

I figured it out myself. So i will answer my own question. Here's sample code:

[Code]
const DB_PAGE_CAPTION='Select Application Database Folder';
  DB_PAGE_DESCRIPTION='Where should application database files be installed or where     your database files already are?';
  DB_PAGE_SUBCAPTION='In case of new installation select the folder in which Setup should install application database files, then click Next. Or select folder where previous version of application stored database files, then click Next';

var databasePage : TInputDirWizardPage;//this is predefined form declaration
    CheckListBox : TNewCheckListBox;  //this is new element i'm about to add to page

procedure createDatabaseWizardPage; //creating page
begin
databasePage :=CreateInputDirPage(wpSelectDir,
DB_PAGE_CAPTION,
DB_PAGE_DESCRIPTION,
DB_PAGE_SUBCAPTION,
False, '');
databasePage.Add('');

databasePage.buttons[0].Top:=databasePage.buttons[0].Top+ScaleY(70);//moving predefined 
databasePage.edits[0].Top:=databasePage.edits[0].Top+ScaleY(70);    //elements down.
databasePage.edits[0].Text:=ExpandConstant('{commonappdata}\my app');//default value

CheckListBox := TNewCheckListBox.Create(databasePage);//creating and modifying new checklistbox
CheckListBox.Top := 40 + ScaleY(8);
CheckListBox.Width := databasePage.SurfaceWidth;
CheckListBox.Height := ScaleY(50);
CheckListBox.BorderStyle := bsNone;
CheckListBox.ParentColor := True;
CheckListBox.MinItemHeight := WizardForm.TasksList.MinItemHeight;
CheckListBox.ShowLines := False;
CheckListBox.WantTabs := True;
CheckListBox.Parent := databasePage.Surface;//setting control's parent element
CheckListBox.AddRadioButton('New Installation', '', 0, True, True, nil);
CheckListBox.AddRadioButton('Update existing copy', '', 0, False, True, nil);
end;


procedure InitializeWizard;
begin
createDatabaseWizardPage(); 
end;

Thanks everybody! :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文