View Single Post
  #3  
Old 21-02-2018, 06:31
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,689
Thanks: 1,106
Thanked 7,336 Times in 2,838 Posts
KaktoR is on a distinguished road
What you mean with "win dir part" ?

For icons create first variables then functions and procedures

Example:

Code:
var
StartMenuIcons, DesktopIconCheckBox: TNewCheckBox;


function CreateIcons: Boolean;
begin
  Result := DesktopIconCheckBox.Checked;
end;

procedure StartMenuIconsClick(Sender: TObject);
begin
  if StartMenuIcons.Checked = True then begin
    WizardForm.GroupEdit.Enabled := False;
    WizardForm.GroupBrowseButton.Enabled := False;
  end else begin
    WizardForm.GroupEdit.Enabled := True;
    WizardForm.GroupBrowseButton.Enabled := True;
  end;
end;
Then checks for Icons
Code:
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExec}"; Check: CreateIcons
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExec}"; Check: CreateIcons
After this you have to place it in WizardForm like this

Code:
procedure InitializeWizard();
begin

StartMenuIcons := TNewCheckBox.Create(WizardForm);
  with StartMenuIcons do begin
    Parent := WizardForm.SelectDirPage;
    Left := ScaleX(8);
    Top := ScaleY(150);
    Width := ScaleX(240);
    Height := ScaleY(17);
    Caption := 'Create Start menu icons';
    OnClick := @StartMenuIconsClick; //Which action should be performed when OnClick (=clicked)
  end;

  DesktopIconCheckBox := TNewCheckBox.Create(WizardForm);
  with DesktopIconCheckBox do begin
    Parent := WizardForm.SelectDirPage;
    Left := ScaleX(8);
    Top := ScaleY(170);
    Width := ScaleX(240);
    Height := ScaleY(17);
    Caption := 'Create Desktop icon';
  end;

end;
For left/top/width/height you can also use SetBounds(Left, Top, Width, Height);.
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
ZakirAhmad (21-02-2018)