title: Inno Setup - Conditional downloads based on tasks or components
body: <p>I'm using Inno Setup 5.4.2 (a) to create a bootstrapper. Now I finally got it so that based on components selected the bootstrapper downloads the needed files for the components and then installs them.</p>
  
  <p>However because the component files need to be downloaded it shows 0.1 mb diskspace needed and I would like it to show each individual size of the file to be downloaded in the select components screen.</p>
  
  <p>I'm using InnoTools Downloader from <a href="http://www.sherlocksoftware.org" rel="nofollow">http://www.sherlocksoftware.org</a> and I've setup up function to get file size:</p>
  
  <pre><code>[Code]
  var
    setup: Double;
    drivers: Double;
  
  function ITD_GetFileSize(const url: string; var size:cardinal): boolean;
  procedure InitializeWizard();
  begin
   itd_init;
   ITD_GetFileSize('http://www.domain.com/file1.exe',setup);
   ITD_GetFileSize('http://www.domain.com/drivers.exe',drivers);
  end;
  </code></pre>
  
  <p>The files are downloaded after components selection (of course). The translation file I found</p>
  
  <pre><code>ComponentSize1=%1 KB
  ComponentSize2=%1 MB
  </code></pre>
  
  <p>I've been searching for a method on how I can make it so that the file size is set correctly but can't seem to find it. With custom messages I might be able to set it once but then it won't work for both files.. I can't find any examples for using custom messages like this with passing a variable to it. Could any body help me out with this?</p>
  
  <p>Thanks</p>