title: InnoSetup Dynamic ComboBox, check which item is selected and execute program
body: <p>In InnoSetup I want to disply a ComboBox on the Finished Page which shows the Components that were installed.
  You can choose "None" or any of the installed Components and start the associated program when clicking on finish.</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>procedure CurPageChanged(CurPageID: Integer);
  var
    NewComboBox1: TNewComboBox;
  begin
    if (CurPageID = wpFinished) then begin
    NewComboBox1 := TNewComboBox.Create(WizardForm);
    with NewComboBox1 do begin
      Parent := WizardForm.FinishedPage;
      Left := ScaleX(256);
      Top := ScaleY(208);
      Width := ScaleX(145);
      Height := ScaleY(21);
      ItemIndex := 0;
      Style := csDropDownList;
      Items.Add('None');
      if IsComponentSelected('1') then
      Items.Add('Component 1');
      if IsComponentSelected('2') then
      Items.Add('Component 2');
      if IsComponentSelected('3') then
      Items.Add('Component 3');
      end;
    end;
  end;
  </code></pre>
  
  <p>First I want to set "None" as automatically selected. when the page is shown. I have looked up many Pascal forums but none of the solutions worked, like NewComboBox1.ItemSelected=0 (or similar, don't remember correctly...). So how do I achieve this?</p>
  
  <p>Then I don't know how to make a program start when clicking on Finish. I thought</p>
  
  <pre><code>function NextButtonClick
  </code></pre>
  
  <p>might help but then no Next button worked in the setup.</p>
  
  <p>Maybe there is also a problem because the list is created depending on which Components were selected, so item 1 is not Component 1, if Component 1 was not selected but Component 2 for instance.</p>
  
  <p>I thought one might solve this by making the items invisible instead of not creating them at all.</p>
  
  <p>I looked in the Support Classes Reference in the IS help file but didn't find anything that would help me.</p>
  
  <p>I am looking forward to your answers!</p>