diff --git a/DS4Windows/App.xaml.cs b/DS4Windows/App.xaml.cs index 1a2f930..5611186 100644 --- a/DS4Windows/App.xaml.cs +++ b/DS4Windows/App.xaml.cs @@ -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); diff --git a/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs b/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs index 7738c53..67c060e 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs +++ b/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs @@ -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")); });