From b3b4d0dad6f0fc9d4dccc3a18f0715dbe7aeabd5 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Thu, 23 Mar 2023 19:16:52 -0500 Subject: [PATCH] Attempt extraction multiple times in case tmp file is still in use --- LANCommander.Playnite.Extension/InstallController.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/LANCommander.Playnite.Extension/InstallController.cs b/LANCommander.Playnite.Extension/InstallController.cs index d86d1a3..44c3923 100644 --- a/LANCommander.Playnite.Extension/InstallController.cs +++ b/LANCommander.Playnite.Extension/InstallController.cs @@ -55,7 +55,13 @@ namespace LANCommander.PlaynitePlugin Plugin.DownloadCache[gameId] = tempDownloadLocation; } - var installDirectory = Extract(game, tempDownloadLocation); + var installDirectory = RetryHelper.RetryOnException(10, TimeSpan.FromMilliseconds(500), "", () => + { + return Extract(game, tempDownloadLocation); + }); + + if (installDirectory == "") + throw new Exception("Could not extract the install archive. Retry the install or check your connection."); var installInfo = new GameInstallationData() {