Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppName=My Program
- AppVersion=1.5
- DefaultDirName={pf}\My Program
- [Registry]
- Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{code:GetDirPath}"
- [Code]
- var
- InputPage: TInputDirWizardPage;
- RadioButtons: array[0..1] of TNewRadioButton;
- function GetDirPath(Param: string): string;
- begin
- Result := InputPage.Values[0];
- end;
- procedure ShiftDirPageItem(Page: TInputDirWizardPage; Index: Integer;
- Offset: Integer);
- begin
- Page.Edits[Index].Top := Page.Edits[Index].Top + Offset;
- Page.Buttons[Index].Top := Page.Buttons[Index].Top + Offset;
- Page.PromptLabels[Index].Top := Page.PromptLabels[Index].Top + Offset;
- end;
- procedure SetDirPageItemEnabled(Page: TInputDirWizardPage; Index: Integer;
- Enabled: Boolean);
- begin
- Page.Edits[Index].Enabled := Enabled;
- Page.Buttons[Index].Enabled := Enabled;
- Page.PromptLabels[Index].Enabled := Enabled;
- end;
- procedure RadioButtonClick(Sender: TObject);
- begin
- SetDirPageItemEnabled(InputPage, 0, Sender = RadioButtons[1]);
- end;
- procedure InitializeWizard;
- begin
- InputPage := CreateInputDirPage(wpWelcome, 'Caption', 'Description',
- 'SubCaption', False, '');
- InputPage.Add('Prompt');
- RadioButtons[0] := TNewRadioButton.Create(InputPage);
- RadioButtons[0].Parent := InputPage.Surface;
- RadioButtons[0].Left := 0;
- RadioButtons[0].Top := 0;
- RadioButtons[0].Width := InputPage.SurfaceWidth;
- RadioButtons[0].Checked := True;
- RadioButtons[0].Caption := 'Option with no file selection';
- RadioButtons[0].OnClick := @RadioButtonClick;
- RadioButtons[1] := TNewRadioButton.Create(InputPage);
- RadioButtons[1].Parent := InputPage.Surface;
- RadioButtons[1].Left := RadioButtons[0].Left;
- RadioButtons[1].Top := RadioButtons[0].Top + RadioButtons[0].Height + 2;
- RadioButtons[1].Width := InputPage.SurfaceWidth;
- RadioButtons[1].Checked := False;
- RadioButtons[1].Caption := 'Option with file selection';
- RadioButtons[1].OnClick := @RadioButtonClick;
- ShiftDirPageItem(InputPage, 0, RadioButtons[1].Top);
- SetDirPageItemEnabled(InputPage, 0, False);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement