01.how to show Component Page before the Select Dir Page (without creating custom forms or anything like that) in
Inno setup 5.5.1 ee2 version?
02.how to calculate the required disk space based on the components selected and show in gigabyte on Component page in
Inno setup 5.5.1 ee2 version?
I actually found an answer to this. But it doesn't work. If someone gives an answer to these two, it will be a great help <3
Code:
var
Component1Size: Extended;
Component2Size: Extended;
// Add variables for each component as needed
procedure InitializeWizard;
begin
Component1Size := 1048576;
Component2Size := 2097152;
// Assign sizes for other components if needed
end;
function GetTotalSize: String;
var
TotalSize: Extended;
begin
TotalSize := 0;
if WizardForm.ComponentsList.Checked[0] then
TotalSize := TotalSize + Component1Size;
if WizardForm.ComponentsList.Checked[1] then
TotalSize := TotalSize + Component2Size;
// Add similar lines for other components if needed
Result := FormatFloat('#,##0.00', TotalSize / 1024 / 1024 / 1024); // Convert bytes to gigabytes
end;
procedure ComponentsPageOnNextButtonClick(Sender: TWizardPage; var Continue: Boolean);
begin
if Sender.ID = wpSelectComponents then
WizardForm.DiskSpaceLabel.Caption := 'Required disk space: ' + GetTotalSize + ' GB';
end;