Can I get ExtraDiskSpaceRequired from code?

41 views
Skip to first unread message

George Hovhannisian

unread,
Jul 5, 2021, 12:19:13 PM7/5/21
to innosetup
This is what I'm trying to do:

[Setup]
ExtraDiskSpaceRequired={code:GetRequiredDiscSpace}

[Code]

function GetRequiredDiscSpace(Param: String): String;
begin
  Result := '1234';
end;

However the compiler says that the value is invalid.

Gavin Lambert

unread,
Jul 11, 2021, 6:38:34 PM7/11/21
to inno...@googlegroups.com
Unless the documentation for a [Setup] setting explicitly says "The
value may include constants", it can't. This is generally limited to
string values only used at runtime.

As far as I am aware, the only way to programmatically manipulate this
value is to select/deselect components (using either their real sizes or
the ExtraDiskSpaceRequired value at the component level, which also
cannot include constants).

Bear in mind that the disk space usage is cited as a minimum, and as
such is basically useless anyway.
Reply all
Reply to author
Forward
0 new messages