Order of custom pages in Inno Setup

Viewed 121

I am using Inno Setup. I want to have two custom pages like:

var
 PasswordEdit: TPasswordEdit;
 UserEdit: TEdit;
 Page: TWizardPage;
 Page2: TWizardPage;
...
 Page := CreateCustomPage(wpWelcome, 'Page1', '');
 Page2 := CreateCustomPage(wpWelcome, 'Page2', '');

But Page2 is appearing before Page. Is this the proper way to create more custom pages?

1 Answers

If you want page 2 after page 1, then do:

Page2 := CreateCustomPage(Page.ID, 'Page2', '');

CreateCustomPage returns a TWizardPage. This has an ID property. This is what you can pass to the other functions.


So:

var
 PasswordEdit: TPasswordEdit;
 UserEdit: TEdit;
 Page: TWizardPage;
 Page2: TWizardPage;
...
 Page := CreateCustomPage(wpWelcome, 'Page1', '');
 Page2 := CreateCustomPage(Page.ID, 'Page2', '');
Related