// TODO: This has to be a precheck, because of parallel download tasks
        private static void ValidateEnoughDiskSpaceAvailable(IComponent component)
        {
            var option = DiskSpaceCalculator.CalculationOption.Download;

            if (UpdateConfiguration.Instance.DownloadOnlyMode)
            {
                option |= DiskSpaceCalculator.CalculationOption.Install;
                if (UpdateConfiguration.Instance.BackupPolicy != BackupPolicy.Disable)
                {
                    option |= DiskSpaceCalculator.CalculationOption.Backup;
                }
            }

            DiskSpaceCalculator.ThrowIfNotEnoughDiskSpaceAvailable(component, AdditionalSizeBuffer, option);
        }
        private static void ValidateEnoughDiskSpaceAvailable(IComponent component)
        {
            if (component.RequiredAction == ComponentAction.Keep)
            {
                return;
            }
            var option = DiskSpaceCalculator.CalculationOption.All;

            if (component.CurrentState == CurrentState.Downloaded)
            {
                option &= ~DiskSpaceCalculator.CalculationOption.Download;
            }
            if (UpdateConfiguration.Instance.BackupPolicy == BackupPolicy.Disable)
            {
                option &= ~DiskSpaceCalculator.CalculationOption.Backup;
            }
            DiskSpaceCalculator.ThrowIfNotEnoughDiskSpaceAvailable(component, AdditionalSizeBuffer, option);
        }