From c97976936acf41b19c889d315677aa041cd1897a Mon Sep 17 00:00:00 2001 From: pointfeev Date: Thu, 19 Oct 2023 13:08:26 -0400 Subject: [PATCH] SteamCMD exception visual fixes --- CreamInstaller/Forms/SelectForm.cs | 1 + CreamInstaller/Platforms/Steam/SteamCMD.cs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs index bc8cead..33b87c2 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/SelectForm.cs @@ -605,6 +605,7 @@ internal sealed partial class SelectForm : CustomForm progressLabel.Text = "Setting up SteamCMD . . . "; if (!await SteamCMD.Setup(iProgress)) { + HideProgressBar(); OnLoad(forceScan, true); return; } diff --git a/CreamInstaller/Platforms/Steam/SteamCMD.cs b/CreamInstaller/Platforms/Steam/SteamCMD.cs index 2dcafb4..5630f24 100644 --- a/CreamInstaller/Platforms/Steam/SteamCMD.cs +++ b/CreamInstaller/Platforms/Steam/SteamCMD.cs @@ -122,6 +122,7 @@ internal static class SteamCMD await Cleanup(); if (!FilePath.FileExists()) { + retryDownload: HttpClient httpClient = HttpClientManager.HttpClient; if (httpClient is null) return false; @@ -136,9 +137,9 @@ internal static class SteamCMD } catch (Exception e) { - using DialogForm dialogForm = new(Form.ActiveForm); - if (dialogForm.Show(SystemIcons.Warning, "Failed to download SteamCMD:\n " + e.FormatException(), "Retry", "OK") is not DialogResult.OK) - return false; + if (e.HandleException(caption: Program.Name + " failed to download SteamCMD")) + goto retryDownload; + return false; } } if (DllPath.FileExists())