Skip to content

Commit

Permalink
Fix uninstalling games
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye116477 committed Nov 20, 2024
1 parent 521e653 commit 1117efb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/NileGameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ public static void LaunchUninstaller(List<Game> games)
File.Delete(gameSettingsFile);
}
}
var downloadManager = NileLibrary.GetNileDownloadManager();
var wantedItem = downloadManager.downloadManagerData.downloads.FirstOrDefault(item => item.gameID == game.GameId);
if (wantedItem != null)
{
downloadManager.downloadManagerData.downloads.Remove(wantedItem);
downloadManager.downloadsChanged = true;
}
game.IsInstalled = false;
game.InstallDirectory = "";
game.Version = "";
Expand Down
12 changes: 10 additions & 2 deletions src/NileGameInstallerView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ private async void NileGameInstallerUC_Loaded(object sender, RoutedEventArgs e)

bool gamesListShouldBeDisplayed = false;

var installedAppList = Nile.GetInstalledAppList();

foreach (var installData in MultiInstallData.ToList())
{
Expand All @@ -240,8 +241,15 @@ private async void NileGameInstallerUC_Loaded(object sender, RoutedEventArgs e)
var wantedItem = downloadManager.downloadManagerData.downloads.FirstOrDefault(item => item.gameID == installData.gameID);
if (wantedItem != null)
{
downloadItemsAlreadyAdded.Add(installData.name);
MultiInstallData.Remove(installData);
if (wantedItem.status == DownloadStatus.Completed && installedAppList.FirstOrDefault(i => i.id == installData.gameID) == null)
{
downloadManager.downloadManagerData.downloads.Remove(wantedItem);
}
else
{
downloadItemsAlreadyAdded.Add(installData.name);
MultiInstallData.Remove(installData);
}
}
}

Expand Down

0 comments on commit 1117efb

Please sign in to comment.