From 34d2d74415f1eb706b12a2a80cb6c73117d7f704 Mon Sep 17 00:00:00 2001 From: "ryochan7@protonmail.com" Date: Sun, 29 Dec 2019 16:33:23 -0600 Subject: [PATCH] Added minor check if timer needs to be run --- DS4Windows/DS4Forms/WelcomeDialog.xaml.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs b/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs index 03d7fbe..891d687 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs +++ b/DS4Windows/DS4Forms/WelcomeDialog.xaml.cs @@ -87,17 +87,26 @@ namespace DS4WinWPF.DS4Forms { File.Move(tempInstFileName, filename); } + success = false; // Reset for later check if (File.Exists(DS4Windows.Global.exedirpath + $"\\{InstFileName}")) { //vigemInstallBtn.Content = Properties.Resources.OpeningInstaller; monitorProc = Process.Start(DS4Windows.Global.exedirpath + $"\\{InstFileName}"); vigemInstallBtn.Content = Properties.Resources.Installing; + success = true; } - monitorTimer = new NonFormTimer(); - monitorTimer.Elapsed += ViGEmInstallTimer_Tick; - monitorTimer.Start(); + if (success) + { + monitorTimer = new NonFormTimer(); + monitorTimer.Elapsed += ViGEmInstallTimer_Tick; + monitorTimer.Start(); + } + else + { + vigemInstallBtn.Content = Properties.Resources.InstallFailed; + } } private void ViGEmInstallTimer_Tick(object sender, System.Timers.ElapsedEventArgs e)