From c6b3cbd3fc4b9ae74fcb4fab669abd75ccf54fb9 Mon Sep 17 00:00:00 2001
From: pointfeev <zehmeen@gmail.com>
Date: Tue, 27 Jul 2021 03:13:24 -0500
Subject: [PATCH] Added instant progress updates where necessary

---
 CreamInstaller/InstallForm.cs | 2 +-
 CreamInstaller/MainForm.cs    | 2 +-
 CreamInstaller/Program.cs     | 8 ++++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/CreamInstaller/InstallForm.cs b/CreamInstaller/InstallForm.cs
index 9adc6a6..8c64125 100644
--- a/CreamInstaller/InstallForm.cs
+++ b/CreamInstaller/InstallForm.cs
@@ -20,7 +20,7 @@ namespace CreamInstaller
 
         public void UpdateProgress(int progress)
         {
-            userProgressBar.Value = progress;
+            Program.UpdateProgressInstantly(userProgressBar, progress);
         }
 
         public void UpdateUser(string text, bool log = true)
diff --git a/CreamInstaller/MainForm.cs b/CreamInstaller/MainForm.cs
index 83b430c..a80b2c7 100644
--- a/CreamInstaller/MainForm.cs
+++ b/CreamInstaller/MainForm.cs
@@ -99,8 +99,8 @@ namespace CreamInstaller
             Progress<double> progress = new Progress<double>();
             progress.ProgressChanged += new EventHandler<double>(delegate (object sender, double _progress)
             {
-                progressBar1.Value = (int)_progress;
                 label1.Text = $"Updating . . . {(int)_progress}%";
+                Program.UpdateProgressInstantly(progressBar1, (int)_progress);
             });
 
             label1.Text = "Updating . . . ";
diff --git a/CreamInstaller/Program.cs b/CreamInstaller/Program.cs
index 42b2cc3..b241965 100644
--- a/CreamInstaller/Program.cs
+++ b/CreamInstaller/Program.cs
@@ -52,6 +52,14 @@ namespace CreamInstaller
         public static Task OutputTask;
         public static string OutputFile;
 
+        public static void UpdateProgressInstantly(ProgressBar progressBar, int progress)
+        {
+            progressBar.Maximum++;
+            progressBar.Value = progress + 1;
+            progressBar.Value = progress;
+            progressBar.Maximum--;
+        }
+
         private static void UpdateProgress(int progress)
         {
             if (InstallForm != null)