How to update application size shown in Windows Control panel/Settings app with size of additional downloads in Inno Setup

Viewed 85

I was trying to create an executable, so I included the whole folder that has executable, data files, etc... and its current size was around 39 MB and then when I run executable, it will then download some files (whose names are hard to guess) and expands to 399 MB, but the size doesn't get updated and it's still shown as 39 MB.

Is there any way for the InnoSetup to recognize those external files and then show the exact size?

[Files]
Source: "C:\Users\_\Documents\sample\{#MyAppExeName}"; DestDir: "{app}"; \
  Flags: ignoreversion; Permissions: users-modify
Source: "C:\Users\_\Documents\Python Files\sample\*"; DestDir: "{app}"; \
  Flags: ignoreversion recursesubdirs createallsubdirs external; \
  Permissions: users-modify

I managed to look at other questions, but I couldn't find the exact solution. So I have decided to post this. Sorry if this was already solved.

1 Answers

If you mean the application size shown in the Control Panel or the Settings app, use the ExtraDiskSpaceRequired directive.

[Setup]
ExtraDiskSpaceRequired=418381824

Inno Setup does not have a mechanism to set the value dynamically. All you can do is to programmatically update the EstimatedSize value in uninstall entry of your application after the installation. E.g. from CurStepChanged(ssPostInstall) event.


If the value cannot change on run time, but the size of source files keep changing, you can use the preprocessor to calculate the value for ExtraDiskSpaceRequired on the compile-time.

Related