Skip to content

Commit

Permalink
Merge pull request LavaGang#38 from charlesdeepk/master
Browse files Browse the repository at this point in the history
make the progress bar actually progress
  • Loading branch information
HerpDerpinstine authored Jul 7, 2020
2 parents d660ff8 + 64cacb0 commit 2037651
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MelonLoader.Installer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO.Compression;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using LightJson;
using MelonLoader.AssemblyGenerator;
Expand All @@ -24,6 +25,7 @@ static void Main()
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)3072;
webClient.Headers.Add("User-Agent", "Unity web player");
webClient.DownloadProgressChanged += (object sender, DownloadProgressChangedEventArgs info) => SetPercentage(info.ProgressPercentage / 2);
Application.SetCompatibleTextRenderingDefault(false);
Application.EnableVisualStyles();

Expand Down Expand Up @@ -134,7 +136,7 @@ private static void Install_Normal(string dirpath, string selectedVersion)
{
SetDisplayText("Downloading MelonLoader...");
string tempfilepath = TempFileCache.CreateFile();
webClient.DownloadFile("https://github.com/HerpDerpinstine/MelonLoader/releases/download/" + selectedVersion + "/MelonLoader.zip", tempfilepath);
webClient.DownloadFileTaskAsync("https://github.com/HerpDerpinstine/MelonLoader/releases/download/" + selectedVersion + "/MelonLoader.zip", tempfilepath).Wait();
SetDisplayText("Extracting MelonLoader...");
SetPercentage(50);
Cleanup(dirpath, false);
Expand Down

0 comments on commit 2037651

Please sign in to comment.