Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1197,19 +1197,40 @@ private async Task UpgradeRoblox()

if (!App.Settings.Prop.DebugDisableVersionPackageCleanup)
{
foreach (string hash in cachedPackageHashes)
if (!App.Settings.Prop.DisableCachingDownloads)
{
if (!allPackageHashes.Contains(hash))
foreach (string hash in cachedPackageHashes)
{
App.Logger.WriteLine(LOG_IDENT, $"Deleting unused package {hash}");
if (!allPackageHashes.Contains(hash))
{
App.Logger.WriteLine(LOG_IDENT, $"Deleting unused package {hash}");

try
{
File.Delete(Path.Combine(Paths.Downloads, hash));
}
catch (Exception ex)
{
App.Logger.WriteLine(LOG_IDENT, $"Failed to delete {hash}!");
App.Logger.WriteException(LOG_IDENT, ex);
}
}
}
}
else
{
// its better to just delete all the files in downloads
foreach (FileInfo pkg in new DirectoryInfo(Paths.Downloads).GetFiles())
{
App.Logger.WriteLine(LOG_IDENT, $"Cleaning up package '{pkg.Name}'");

try
{
File.Delete(Path.Combine(Paths.Downloads, hash));
pkg.Delete();
}
catch (Exception ex)
{
App.Logger.WriteLine(LOG_IDENT, $"Failed to delete {hash}!");
App.Logger.WriteLine(LOG_IDENT, "Failed to delete package!");
App.Logger.WriteException(LOG_IDENT, ex);
}
}
Expand Down
1 change: 1 addition & 0 deletions Bloxstrap/Models/Persistable/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Settings
public bool WPFSoftwareRender { get; set; } = false;
public bool EnableAnalytics { get; set; } = true;
public bool BackgroundUpdatesEnabled { get; set; } = false;
public bool DisableCachingDownloads { get; set; } = false;
public bool DebugDisableVersionPackageCleanup { get; set; } = false;
public string? SelectedCustomTheme { get; set; } = null;
public WebEnvironment WebEnvironment { get; set; } = WebEnvironment.Production;
Expand Down
18 changes: 18 additions & 0 deletions Bloxstrap/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Bloxstrap/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1386,4 +1386,10 @@ Defaulting to {1}.</value>
<data name="Menu.FastFlagEditor.AllowlistInformation" xml:space="preserve">
<value>Due to the [Fast Flag allowlist update]({0}), most custom Fast Flags will have no effect on the Roblox player.</value>
</data>
<data name="Menu.Behaviour.DisableCachingDownloads.Description" xml:space="preserve">
<value>Prevents Bloxstrap from caching Roblox version update files. This will slow down updates.</value>
</data>
<data name="Menu.Behaviour.DisableCachingDownloads.Title" xml:space="preserve">
<value>Disable caching Roblox update files</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Bloxstrap/UI/Elements/Settings/Pages/BootstrapperPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<ui:ToggleSwitch IsChecked="{Binding BackgroundUpdates, Mode=TwoWay}" />
</controls:OptionControl>

<controls:OptionControl
Header="{x:Static resources:Strings.Menu_Behaviour_DisableCachingDownloads_Title}"
Description="{x:Static resources:Strings.Menu_Behaviour_DisableCachingDownloads_Description}">
<ui:ToggleSwitch IsChecked="{Binding DisableCachingDownloads, Mode=TwoWay}" />
</controls:OptionControl>

<controls:OptionControl
Header="{x:Static resources:Strings.Menu_Behaviour_ForceRobloxReinstall_Title}"
Description="{x:Static resources:Strings.Menu_Behaviour_ForceRobloxReinstall_Description}">
Expand Down
6 changes: 6 additions & 0 deletions Bloxstrap/UI/ViewModels/Settings/BehaviourViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public bool BackgroundUpdates
set => App.Settings.Prop.BackgroundUpdatesEnabled = value;
}

public bool DisableCachingDownloads
{
get => App.Settings.Prop.DisableCachingDownloads;
set => App.Settings.Prop.DisableCachingDownloads = value;
}

public bool IsRobloxInstallationMissing => !App.IsPlayerInstalled && !App.IsStudioInstalled;

public bool ForceRobloxReinstallation
Expand Down