4

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

Jens A. Koch
  • 39,862
  • 13
  • 113
  • 141
stevesrs
  • 57
  • 1
  • 7

1 Answers1

0

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

Deanna
  • 23,876
  • 7
  • 71
  • 156
  • thanks, that is indeed 'a' solution but it won't set the size of the individual components and won't show it in the component style. So not really the solution I'm looking for.. I have file size of both in a variable.. there has to be some way to use these with custom messages or something like this – stevesrs Dec 13 '11 at 07:12
  • How do you mean it won't set the size of individual components? The parameter I pointed to is specific to individual comnponents. You can use the custom messages wherever you want, by creating your own labels or replacing existing ones. – Deanna Dec 13 '11 at 11:01
  • according to inno setup help: Description: Normally, the disk space requirement displayed on the wizard is calculated by adding up the size of all the files in the [Files] section. If you want to increase the disk space display for whatever reason, set ExtraDiskSpaceRequired to the amount of bytes you wish to add to this figure. (1048576 bytes = 1 megabyte) this doesn't mention anything about setting is per component or how. What I'm trying to accomplish is that in the 'select component' screen it shows the size of the 2 components (at right side) before they are actually downloaded. – stevesrs Dec 14 '11 at 08:30
  • *sigh* There are two, the parameter I linked to (yes, it is a [link to the help](http://www.jrsoftware.org/ishelp/topic_componentssection.htm#ExtraDiskSpaceRequired)) is of a `[Components]` entry which does what you want. You're reading the help for the [global value](http://www.jrsoftware.org/ishelp/topic_setup_extradiskspacerequired.htm) which is not what you want. – Deanna Dec 14 '11 at 09:34
  • great, that works! I'm going to try and make it dynamic but at least this is a good solution for now as it does exactly as I want. Thanks – stevesrs Dec 16 '11 at 04:40
  • Can you please [accept the answer](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) by clicking the green tick to the left of the post. – Deanna Dec 16 '11 at 08:54
  • If this answer helped solve your problem, can you [accept the answer](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) by clicking the green tick to the left of the post. If it didn't, can you provide more information on what you're trying to do and how the suggestion didn't work. – Deanna Dec 23 '11 at 10:06
  • sorry, december month is a busy one so had to put this aside for a couple days. As I said before solution works but making it dynamic doesn't really seem to work. itd_GetFileSize('www.url.com/setup.exe',fsize); alwyas gives type mismatch (tried defining fsize as integer, double, string). I tried contact creator of that plugin but haven't got any response on that. And also when defining ExtraDiskSpaceRequired it doesn't accept a variable it seems, so even when I could get the filesize read from an online file I still can't assign it to value for ExtraDiskSpaceRequired param – stevesrs Dec 29 '11 at 23:14
  • It's only an estimate, and even then, it's the size post install, not of the download which are usually fairly static. – Deanna Dec 29 '11 at 23:57