View Single Post
  #4  
Old 21-02-2018, 07:01
ZakirAhmad ZakirAhmad is offline
Registered User
 
Join Date: Sep 2015
Location: Kmr
Posts: 290
Thanks: 56
Thanked 58 Times in 37 Posts
ZakirAhmad is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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);.
sorry bro SelectDirPage.

Bro i also want to change srepinit virtual memory to percentage value. but the cls.ini is overwritten by srepinit function of of isdone. Please help me here.
i also how can i add in info page of setup like FItgirl.

thanks
Reply With Quote