Quote:
Originally Posted by HunterEmrah
I tried something but could not give the correct size to "Main files" component, on components page first time size is right, but after clicking components it's resets.
what i changed in script.iss
Given size in Settings.ini
I've uploaded a video for a better understanding.
https://streamable.com/wsa4j
|
Try this:
Leave as before the part you changed:
ComponentsSize:=0;
1. Then replace the original line (Line commented with //) with the line below in this part.
Code:
procedure ComponentsOnCheck(Sender: TObject);
var
I: Integer;
begin
ComponentsSize := 0;
for I := 0 to GetArrayLength(CompIndexList) - 1 do
if ComponentsList.Checked[CompIndexList[I]] then
ComponentsSize := ComponentsSize + GetSizeBytes(GetIniString('ComponentsSettings', 'Component' + IntToStr(CompIndexList[I]) + '.Size', '0', ExpandConstant('{tmp}\Settings.ini')));
//ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize, '', 0));
ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize + GetSizeBytes(GetIniString('Settings', 'Size', '0', ExpandConstant('{tmp}\Settings.ini'))), '', 0));
end;
2/3. Then substitute the original line (Line commented with "//") by the line below (Required to replace 2 times in the script)
Code:
//ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize, '', 0));
ComponentsDiskSpaceLabel.Caption := DiskSpaceMB(SetupMessage(msgComponentsDiskSpaceMBLabel), SizeBytesToMB(ComponentsSize + GetSizeBytes(GetIniString('Settings', 'Size', '0', ExpandConstant('{tmp}\Settings.ini'))), '', 0));