View Single Post
  #14  
Old 31-03-2019, 07:14
HunterEmrah HunterEmrah is offline
Registered User
 
Join Date: Jan 2013
Location: Canada
Posts: 59
Thanks: 28
Thanked 15 Times in 13 Posts
HunterEmrah is on a distinguished road
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
Quote:
Code:
  I := 1;
  ComponentsSize := GetSizeBytes(GetIniString('Settings', 'Size', '0', IniFile));
  SetArrayLength(CompIndexList, 0);
  IniFile := ExpandConstant('{tmp}\Settings.ini');
  ComponentsPageAvai := GetIniBool('ComponentsSettings', 'Enable', False, IniFile);
  if ComponentsPageAvai then
  begin
    if IniKeyExists('ComponentsSettings', 'Component' + IntToStr(I) + '.Name', IniFile) then
    begin
      CompName := CustomMessage('CompMain'); //Main Files component
      ComponentsList.AddCheckBox(CompName, '', 0, True, False, True, True, nil);
    end;
Given size in Settings.ini
Quote:
Code:
[Settings]
Name=Tropico 6
Size=12.4 gb
I've uploaded a video for a better understanding.
https://streamable.com/wsa4j
Reply With Quote
The Following User Says Thank You to HunterEmrah For This Useful Post:
Titeuf (31-03-2019)