title: Inno Setup - See how many components are selected
body: <p>Actually, I only need to see if it's <code>1</code> or more. Here's how I'm planning to use it:</p>
  
  <pre><code>if [Only one component is selected] then
  begin
    Result := CustomMessage('[Name of that component]');
    if IsComponentSelected('[Specific Component]') then
    begin
      if IsTaskSelected('[Task]') then
      begin
        Result := CustomMessage('[Name of that task]');
      end
    end
  end
  if [More than one component is selected] then
  begin
    Result := 'Full Feature';// or '{#SetupSetting("AppName")}'
  end;
  </code></pre>
  
  <p>I think I know at least one "workaround" way to do this, but I'm wondering if this can be done with more conventional Inno ways (and cleaner code).</p>
  
  <p><strong>-----Edit-----</strong></p>
  
  <p>Final function using Martins answer:</p>
  
  <pre><code>function UninstallName(Value: string): string;
  begin
    if GetSelectedComponentsCount = 1 then
    begin
      Result := CustomMessage(WizardSelectedComponents(False));
      if IsComponentSelected('bc2') then
      begin      
        if IsTaskSelected('bc2tp2') then
        begin
          Result := CustomMessage('bc2tp2');
        end;
      end;
      if Pos(':',Result) &gt; 1 then
      StringChangeEx(Result, ':', ' -', False)
    end;
    if GetSelectedComponentsCount &gt; 1 then
    begin
      Result := '{#SetupSetting("AppName")}';
    end;
  end;
  </code></pre>