diff --git a/StabilityMatrix/LaunchPage.xaml b/StabilityMatrix/LaunchPage.xaml index cc2c4627..ac3ee1c7 100644 --- a/StabilityMatrix/LaunchPage.xaml +++ b/StabilityMatrix/LaunchPage.xaml @@ -19,8 +19,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - - + + @@ -58,10 +58,8 @@ VerticalAlignment="Top" d:DataContext="{d:DesignInstance Type=models:InstalledPackage, IsDesignTimeCreatable=True}"> - - - - + + @@ -186,7 +184,7 @@ + Text="{Binding DisplayName, Mode=OneWay}" /> @@ -208,13 +206,15 @@ TextWrapping="Wrap" VerticalAlignment="Stretch" /> - + diff --git a/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs b/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs index 500a5517..d4f36ded 100644 --- a/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs +++ b/StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs @@ -102,20 +102,29 @@ public partial class SelectInstallLocationsViewModel : ObservableObject } // No settings.json - // Check if the directory is empty + + // Check if the directory is %APPDATA%\StabilityMatrix: hide badge and set directory valid + if (DataDirectory == DefaultInstallLocation) + { + IsStatusBadgeVisible = false; + IsDirectoryValid = true; + return true; + } + + // Check if the directory is empty: hide badge and set directory to valid var isEmpty = !Directory.EnumerateFileSystemEntries(DataDirectory).Any(); - // If not, show error badge, and set directory to invalid to prevent continuing - if (!isEmpty) + if (isEmpty) { - IsStatusBadgeVisible = true; - IsDirectoryValid = false; - DirectoryStatusText = InvalidDirectoryText; - return false; + IsStatusBadgeVisible = false; + IsDirectoryValid = true; + return true; } - // Otherwise, hide badge and set directory to valid - IsStatusBadgeVisible = false; - IsDirectoryValid = true; - return true; + + // Not empty and not appdata: show error badge, and set directory to invalid + IsStatusBadgeVisible = true; + IsDirectoryValid = false; + DirectoryStatusText = InvalidDirectoryText; + return false; } [RelayCommand]