installationinno-setupinno-tools-downloader

Inno Setup - Conditional downloads based on tasks or components


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.

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.

I'm using InnoTools Downloader from http://www.sherlocksoftware.org and I've setup up function to get file size:

[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;

The files are downloaded after components selection (of course). The translation file I found

ComponentSize1=%1 KB
ComponentSize2=%1 MB

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?

Thanks


Solution

  • Use the ExtraDiskSpaceRequired parameter to the [Components] entry to specify any space needed by external components.