title: How can I add a check box for optional files during install in Inno Setup?
body: <p>I'm trying to make a custom checkbox in my custom page (because it's a one page installer), is needed only a checkbox without dialogs or anything, the installer that I'm trying to compile is very linear and simple.</p>
  
  <p>I want to bind <code>FILE3.EXE</code> on a checkbox in this way: if checkbox is checked copy the file (<code>FILE3.EXE</code>) in <code>DestDir</code>, otherwise if checkbox is unchecked skip the file (<code>FILE3.EXE</code>) during installation.</p>
  
  <p>This is the code that I used, obviously the checkbox code is missing because I'm not able to do that</p>
  
  <pre><code>[Files]
  Source: FILE1.EXE; DestDir: {app};
  Source: FILE2.EXE; DestDir: {app};
  Source: FILE3.EXE; DestDir: {app}; //OPTIONAL
  </code></pre>
  
  <pre class="lang-pascal prettyprint-override"><code>[Code]
  procedure ExitProcess(uExitCode: UINT);
  external 'ExitProcess@kernel32.dll stdcall';
  
  var
    MainPage : TWizardPage;
    FolderToInstall : TEdit;
    InstallLocation : String;
  
  procedure CancelClick(Sender: TObject);
  begin
    if ExitSetupMsgBox then
    begin
      ExitProcess(0);
    end;
  end;
  
  procedure BrowseClick(Sender : TObject);
  var
    Dir : String;
  
  begin
    Dir := FolderToInstall.Text;
    if BrowseForFolder('Browse',Dir,false) then
      FolderToInstall.Text := Dir;
    WizardForm.DirEdit.Text := Dir;
  end;
  
  procedure InitializeWizard();
  var
    LabelFolder : TLabel;
  begin
    MainPage := CreateCustomPage(wpWelcome,'','');
    LabelFolder := TLabel.Create(MainPage);
    LabelFolder.Parent := WizardForm;
    LabelFolder.Top := 164;
    LabelFolder.Left := 6;
    LabelFolder.Caption := 'Directory:'
  
    FolderToInstall := TEdit.Create(MainPage);
    FolderToInstall.Parent := WizardForm;
    FolderToInstall.Top := 182;
    FolderToInstall.Left := 85;
    FolderToInstall.Width := 380;
    FolderToInstall.Text :=  WizardDirValue;
    FolderToInstall.ReadOnly := True;
  end;
  </code></pre>