Fixed ViGEm installer download in Welcome Dialog

This commit is contained in:
Travis Nickles 2019-12-27 01:12:36 -06:00
parent 09f7635b47
commit 32328e0e15
2 changed files with 16 additions and 1 deletions

View File

@ -244,6 +244,7 @@ namespace DS4WinWPF
}
else if (parser.Driverinstall)
{
CreateBaseThread();
DS4Forms.WelcomeDialog dialog = new DS4Forms.WelcomeDialog(true);
dialog.ShowDialog();
runShutdown = false;
@ -309,6 +310,20 @@ namespace DS4WinWPF
Thread.SpinWait(500);
}
private void CreateBaseThread()
{
controlThread = new Thread(() => {
DS4Windows.Program.rootHub = rootHub;
requestClient = new HttpClient();
collectTimer = new Timer(GarbageTask, null, 30000, 30000);
});
controlThread.Priority = ThreadPriority.Normal;
controlThread.IsBackground = true;
controlThread.Start();
while (controlThread.IsAlive)
Thread.SpinWait(500);
}
private void GarbageTask(object state)
{
GC.Collect(0, GCCollectionMode.Forced, false);

View File

@ -61,7 +61,7 @@ namespace DS4WinWPF.DS4Forms
// This is your progress event!
// It will fire on every buffer fill so don't do anything expensive.
// Writing to the console IS expensive, so don't do the following in practice...
vigemInstallBtn.Content = Properties.Resources.Downloading.Replace("*number*",
vigemInstallBtn.Content = Properties.Resources.Downloading.Replace("*number*%",
x.PercentComplete.ToString("P"));
//Console.WriteLine(x.PercentComplete.ToString("P"));
});