Inno Setup tip [instance] add custom page

Source: Internet
Author: User

You can use the "add custom page" to enrich the features of the installer. This article takes "Select installation type" as an example to add a page. Selecting Standard installation skips the "select target location" and "Select Start Menu folder" pages.

Add the following Code in the [Code] section:

VarPage: TWizardPage; rack, RadioButton2: TRadioButton; Lbl1, Lbl2: TNewStaticText; procedure CreateAddonPage; beginPage: = CreateCustomPage ', 'select the installation type as needed '); RadioButton1: = TRadioButton. create (Page); RadioButton1.Left: = ScaleX (80); RadioButton1.Top: = ScaleY (40); RadioButton1.Width: = Page. surfaceWidth; RadioButton1.Height: = ScaleY (17); RadioButton1.Caption: = 'standard installation'; RadioButton1.Checked: = True; RadioButton1.Parent: = Page. surface; Lbl1: = TNewStaticText. create (Page); Lbl1.Left: = ScaleX (95); Lbl1.Top: = ScaleY (60); Lbl1.Width: = ScaleX (250); Lbl1.Height: = ScaleY (50); Lbl1.Caption: = 'Install software to your computer in standard mode'; Lbl1.Parent: = Page. surface; RadioButton2: = TRadioButton. create (Page); RadioButton2.Left: = ScaleX (80); RadioButton2.Top: = RadioButton1.Top + ScaleY (60); RadioButton2.Width: = Page. surfaceWidth; RadioButton2.Height: = ScaleY (17); RadioButton2.Caption: = 'custom installation'; RadioButton2.Checked: = false; RadioButton2.Parent: = Page. surface; Lbl2: = TNewStaticText. create (Page); Lbl2.Left: = ScaleX (95); Lbl2.Top: = Lbl1.Top + ScaleY (60); Lbl2.Width: = ScaleX (250); Lbl2.Height: = ScaleY (50 ); lbl2.Caption: = 'You can select a single installation item. It is recommended that you use it with rich experience'; Lbl2.Parent: = Page. surface; end; procedure InitializeWizard (); beginCreateAddonPage; end; function ShouldSkipPage (PageID: Integer): Boolean; beginif (PageID = wpSelectDir) and (RadioButton1.Checked) thenResult: = Trueelse if (PageID = wpSelectProgramGroup) and (RadioButton1.Checked) thenResult: = Trueend;

 

In the code, the red part indicates the CurPageID value of the Wizard Page followed by the custom page, and the blue part indicates the title and description of the custom page, respectively.

 

Default Value:

Custom:

 

From: http://hi.baidu.com/watashi/item/b3dda993459ff8f0291647a0

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.