Innosetup A new wizard page to let users choose how to Install
Reproduced in: http://www.docin.com/p-612536939.html
In the Innosetup Wizard page, add a page with two installation options
1. Selecting a standard installation skips pages such as "Select Destination Location" and "Choose Start Menu Folder". (mainly skip part of the page, quick Install)
2. User-defined installation, can choose the installation directory, etc.
Add the following code to the [code] segment:
Var
Page:twizardpage; {Define a page, in Pascal the curly braces are used to annotate}
RadioButton1, Radiobutton2:tradiobutton; {define 2 radio buttons}
LBL1, Lbl2:tnewstatictext; {Define two labels to describe the installation information}
Procedure Createaddonpage; {New method for adding pages}
Begin
Page: = CreateCustomPage (Wpinfobefore, ' Select installation type ', ' Please select the type of installation according to your needs ');
{Set the properties of radio button 1 and add it to the page}
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;
{Set the properties of the Label1 and add them to the page}
LBL1: = Tnewstatictext.create (Page);
Lbl1.left: = ScaleX (95);
Lbl1.top: = ScaleY (60);
Lbl1.width: = ScaleX (250);
Lbl1.height: = ScaleY (50);
Lbl1.caption: = ' install software in standard mode to your computer ';
Lbl1.parent: = Page.surface;
{Set the properties of radio button 2 and add it to the page}
RadioButton2: = Tradiobutton.create (Page);
Radiobutton2.left: = ScaleX (n);
Radiobutton2.top: = Radiobutton1.top + ScaleY;
radiobutton2.width: = page.surfacewidth;
radiobutton2.height: = ScaleY (+);
radiobutton2.caption: = ' Custom installation ';
radiobutton2.checked: = false;
radiobutton2.parent: = Page.surface;
{Set the properties of the Label2 and add them to the page}
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 choose a single installation item and suggest that experienced users use ';
Lbl2.parent: = Page.surface;
End
{Call the system's own method, Initializewizard (), call the method we define in this method Createaddonpage--should be called exactly the procedure, not the method}
Procedure Initializewizard ();
Begin
Createaddonpage;
End
{Call the system's own Shouldskippage method, this method is used to skip some wizard pages}
function Shouldskippage (Pageid:integer): Boolean;
Begin
{Skip Selecting the installation directory page The Wpselectdir,wpselectprogramgroup here are Innosetup system presets,
For more Page IDs, please refer to the 3rd} in http://www.cnblogs.com/tommy-huang/p/4121229.html
if (PageID = Wpselectdir) and (radiobutton1.checked) then
Result: = True
else if (PageID = Wpselectprogramgroup) and (radiobutton1.checked) then
Result: = True
End
Innosetup New wizard Page