From 6c09f7c4798d82e1839bf94ede071c1bafc9dec5 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 12 Mar 2025 22:14:01 +0000 Subject: [PATCH] add storage space check --- Bloxstrap/Bootstrapper.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 20f8a27..aa9d1d6 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -400,11 +400,20 @@ namespace Bloxstrap private bool IsEligibleForBackgroundUpdate() { - // TODO: storage check + const string LOG_IDENT = "Bootstrapper::IsEligibleForBackgroundUpdate"; if (App.LaunchSettings.BackgroundUpdaterFlag.Active || _mustUpgrade || IsStudioLaunch) return false; + // at least 3GB of free space + const long minimumFreeSpace = 3_000_000_000; + long space = Filesystem.GetFreeDiskSpace(Paths.Base); + if (space < minimumFreeSpace) + { + App.Logger.WriteLine(LOG_IDENT, $"User has {space} free space, at least {minimumFreeSpace} is required"); + return false; + } + if (_latestVersion == default) // todo: check if this even works return false;