I have code which is used for custom installation using Inno Setup. In this I have two radio buttons on a custom page. If user selects the first radio button, it should show another custom page with user input text box and text to be save in file. If user select the other radio button, the other custom page should not show.
Here is my code
[Code]
var
FullRadioButton: TNewRadioButton;
PartRadioButton: TNewRadioButton;
CustomPage: TWizardPage;
UserInputsPage: TInputQueryWizardPage;
FullDescLabel: TLabel;
PartDescLabel: TLabel;
url: String;
const
FullDescText ='Full Installation.';
PartDescText ='Partial Installation.';
procedure InitializeWizard;
begin
CustomPage := CreateCustomPage(wpWelcome, 'Installation type', '');
FullRadioButton := TNewRadioButton.Create(WizardForm);
FullRadioButton.Parent := CustomPage.Surface;
FullRadioButton.Top := 16;
FullRadioButton.Width := CustomPage.SurfaceWidth;
FullRadioButton.Font.Style := [fsBold];
FullRadioButton.Font.Size := 9;
FullRadioButton.Caption := 'Default Installation'
FullDescLabel := TLabel.Create(WizardForm);
FullDescLabel.Parent := CustomPage.Surface;
FullRadioButton.Checked := True;
FullDescLabel.Left := 8;
FullDescLabel.Top := FullRadioButton.Top + FullRadioButton.Height + 8;
FullDescLabel.Width := CustomPage.SurfaceWidth;
FullDescLabel.Height := 40;
FullDescLabel.AutoSize := False;
FullDescLabel.Wordwrap := True;
FullDescLabel.Caption := FullDescText;
PartRadioButton := TNewRadioButton.Create(WizardForm);
PartRadioButton.Parent := CustomPage.Surface;
//PartRadioButton.Checked := True
PartRadioButton.Top := FullDescLabel.Top + FullDescLabel.Height + 16;
PartRadioButton.Width := CustomPage.SurfaceWidth;
PartRadioButton.Font.Style := [fsBold];
PartRadioButton.Font.Size := 9;
PartRadioButton.Caption := 'Custom Installation'
PartDescLabel := TLabel.Create(WizardForm);
PartDescLabel.Parent := CustomPage.Surface;
PartDescLabel.Left := 8;
PartDescLabel.Top := PartRadioButton.Top + PartRadioButton.Height + 8;
PartDescLabel.Width := CustomPage.SurfaceWidth;
PartDescLabel.Height := 40;
PartDescLabel.AutoSize := False;
PartDescLabel.Wordwrap := True;
PartDescLabel.Caption := PartDescText;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if (PartRadioButton.Checked) then
UserInputsPage := CreateInputQueryPage(wpWelcome,
'Url information', 'Url',
'Please specify the following informat, then click Next.');
UserInputsPage.Add('URL:', False);
UserInputsPage.Values[0] := ExpandConstant('');
if(CurPageID = UserInputsPage.ID) then;
begin
url := UserInputsPage.Values[0];
SaveStringToFile('path', 'user_input='+'"'+url+'"'+#13#10,True);
end;
Result := True;
end;
Please help me out
Thanks in advance!