From 53af12fdae2c6888691e6b80de2f3a90d218ecf1 Mon Sep 17 00:00:00 2001 From: pointfeev Date: Sun, 8 May 2022 17:10:58 -0400 Subject: [PATCH] v3.4.3.1 - Attempted fix for SteamCMD string exception - Attempted fix for weird ExceptionHandler behavior - Fixed weird "Block Protected Games" checkbox sizing for other languages --- CreamInstaller/CreamInstaller.csproj | 2 +- CreamInstaller/Forms/SelectForm.Designer.cs | 12 +++++++----- CreamInstaller/Steam/SteamCMD.cs | 6 +++--- CreamInstaller/Utility/ExceptionHandler.cs | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CreamInstaller/CreamInstaller.csproj b/CreamInstaller/CreamInstaller.csproj index 71b5d20..bc339a6 100644 --- a/CreamInstaller/CreamInstaller.csproj +++ b/CreamInstaller/CreamInstaller.csproj @@ -5,7 +5,7 @@ True Resources\ini.ico true - 3.4.3.0 + 3.4.3.1 Resources\ini.ico LICENSE 2021, pointfeev (https://github.com/pointfeev) diff --git a/CreamInstaller/Forms/SelectForm.Designer.cs b/CreamInstaller/Forms/SelectForm.Designer.cs index 3ae7217..279bc02 100644 --- a/CreamInstaller/Forms/SelectForm.Designer.cs +++ b/CreamInstaller/Forms/SelectForm.Designer.cs @@ -109,7 +109,8 @@ namespace CreamInstaller this.noneFoundLabel.Name = "noneFoundLabel"; this.noneFoundLabel.Size = new System.Drawing.Size(554, 218); this.noneFoundLabel.TabIndex = 1002; - this.noneFoundLabel.Text = "No CreamAPI-applicable or ScreamAPI-applicable programs were found on your computer!"; + this.noneFoundLabel.Text = "No CreamAPI-applicable or ScreamAPI-applicable programs were found on your comput" + + "er!"; this.noneFoundLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.noneFoundLabel.Visible = false; // @@ -123,12 +124,12 @@ namespace CreamInstaller this.flowLayoutPanel1.Location = new System.Drawing.Point(224, -1); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(165, 19); + this.flowLayoutPanel1.Size = new System.Drawing.Size(179, 20); this.flowLayoutPanel1.TabIndex = 1005; // // blockedGamesCheckBox // - this.blockedGamesCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.blockedGamesCheckBox.AutoSize = true; this.blockedGamesCheckBox.Checked = true; this.blockedGamesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; this.blockedGamesCheckBox.Enabled = false; @@ -136,7 +137,7 @@ namespace CreamInstaller this.blockedGamesCheckBox.Location = new System.Drawing.Point(3, 0); this.blockedGamesCheckBox.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); this.blockedGamesCheckBox.Name = "blockedGamesCheckBox"; - this.blockedGamesCheckBox.Size = new System.Drawing.Size(140, 19); + this.blockedGamesCheckBox.Size = new System.Drawing.Size(154, 20); this.blockedGamesCheckBox.TabIndex = 1003; this.blockedGamesCheckBox.Text = "Block Protected Games"; this.blockedGamesCheckBox.UseVisualStyleBackColor = true; @@ -147,7 +148,7 @@ namespace CreamInstaller this.blockProtectedHelpButton.Enabled = false; this.blockProtectedHelpButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this.blockProtectedHelpButton.Font = new System.Drawing.Font("Segoe UI", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.blockProtectedHelpButton.Location = new System.Drawing.Point(143, 0); + this.blockProtectedHelpButton.Location = new System.Drawing.Point(157, 0); this.blockProtectedHelpButton.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); this.blockProtectedHelpButton.Name = "blockProtectedHelpButton"; this.blockProtectedHelpButton.Size = new System.Drawing.Size(19, 19); @@ -293,6 +294,7 @@ namespace CreamInstaller this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); this.flowLayoutPanel2.ResumeLayout(false); this.ResumeLayout(false); diff --git a/CreamInstaller/Steam/SteamCMD.cs b/CreamInstaller/Steam/SteamCMD.cs index 44b0047..6547632 100644 --- a/CreamInstaller/Steam/SteamCMD.cs +++ b/CreamInstaller/Steam/SteamCMD.cs @@ -107,7 +107,7 @@ internal static class SteamCMD } } Interlocked.Decrement(ref locks[i]); - return appInfo; + return appInfo ?? ""; } Thread.Sleep(200); } @@ -221,10 +221,10 @@ internal static class SteamCMD if (File.Exists(appUpdateFile)) output = File.ReadAllText(appUpdateFile, Encoding.UTF8); else { - output = await Run(appId); + output = await Run(appId) ?? ""; int openBracket = output.IndexOf("{"); int closeBracket = output.LastIndexOf("}"); - if (openBracket != -1 && closeBracket != -1) + if (!string.IsNullOrEmpty(output) && openBracket != -1 && closeBracket != -1) { output = $"\"{appId}\"\n" + output[openBracket..(1 + closeBracket)]; output = output.Replace("ERROR! Failed to install app '4' (Invalid platform)", ""); diff --git a/CreamInstaller/Utility/ExceptionHandler.cs b/CreamInstaller/Utility/ExceptionHandler.cs index ce8bc2a..65a8ed1 100644 --- a/CreamInstaller/Utility/ExceptionHandler.cs +++ b/CreamInstaller/Utility/ExceptionHandler.cs @@ -18,8 +18,8 @@ internal static class ExceptionHandler for (int i = 0; i < Math.Min(stackTrace.Length, 3); i++) { string line = stackTrace[i]; - int atNum = line.IndexOf("at "); - int inNum = line.IndexOf("in "); + int atNum = line.LastIndexOf("at "); + int inNum = line.LastIndexOf("in "); int ciNum = line.LastIndexOf(@"CreamInstaller\"); int lineNum = line.LastIndexOf(":line "); if (line is not null && atNum != -1)