diff --git a/WPILibInstaller-Avalonia/ViewModels/InstallPageViewModel.cs b/WPILibInstaller-Avalonia/ViewModels/InstallPageViewModel.cs index 7d24554..49a4ef2 100644 --- a/WPILibInstaller-Avalonia/ViewModels/InstallPageViewModel.cs +++ b/WPILibInstaller-Avalonia/ViewModels/InstallPageViewModel.cs @@ -164,6 +164,10 @@ private async Task InstallEverything(CancellationToken token) ProgressTotal = 88; TextTotal = "Creating Shortcuts"; await RunShortcutCreator(token); + if (token.IsCancellationRequested) break; + ProgressTotal = 99; + TextTotal = "Cleaning Up"; + await RunChoreoCleanup(); } while (false); } catch (OperationCanceledException) @@ -984,5 +988,26 @@ await Task.Run(() => }, token); } } + + private async Task RunChoreoCleanup() + { + if (Directory.Exists(Path.Combine(configurationProvider.InstallDirectory, "choreo"))) { + Text = "Clean up Choreo Directory"; + Progress = 25; + Directory.Delete(Path.Combine(configurationProvider.InstallDirectory, "choreo"), true); + + Text = "Clean up Choreo Scripts"; + Progress = 50; + File.Delete(Path.Combine(configurationProvider.InstallDirectory, "tools", "choreo.vbs")); + File.Delete(Path.Combine(configurationProvider.InstallDirectory, "tools", "choreo.sh")); + + Text = "Clean up Choreo Vendordeps"; + Progress = 75; + File.Delete(Path.Combine(configurationProvider.InstallDirectory, "vendordeps", "ChoreoLib2025Beta.json")); + } + + await Task.Yield(); + } + } }