From aa3d907b2a76514f99799c827d650d832f241359 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 28 May 2019 00:50:50 -0500 Subject: [PATCH] Monitor process rather than search for process name --- DS4Windows/DS4Forms/WelcomeDialog.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DS4Windows/DS4Forms/WelcomeDialog.cs b/DS4Windows/DS4Forms/WelcomeDialog.cs index 0886091..6a8f50e 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.cs +++ b/DS4Windows/DS4Forms/WelcomeDialog.cs @@ -19,6 +19,8 @@ namespace DS4Windows.Forms "https://github.com/ViGEm/ViGEmBus/releases/download/v1.16.112/ViGEmBus_Setup_1.16.115.exe"; private const string InstFileName = "ViGEmBus_Setup_1.16.115.exe"; + Process monitorProc; + public WelcomeDialog(bool loadConfig=false) { if (loadConfig) @@ -71,7 +73,7 @@ namespace DS4Windows.Forms if (File.Exists(exepath + $"\\{InstFileName}")) { bnStep1.Text = Properties.Resources.OpeningInstaller; - Process.Start(exepath + $"\\{InstFileName}", "/quiet"); + monitorProc = Process.Start(exepath + $"\\{InstFileName}", "/quiet"); bnStep1.Text = Properties.Resources.Installing; } @@ -82,8 +84,7 @@ namespace DS4Windows.Forms private void timer_Tick(object sender, EventArgs e) { - Process[] processes = Process.GetProcessesByName("ViGEmBus_Setup_1.16.115"); - if (processes.Length < 1) + if (monitorProc != null && monitorProc.HasExited) { if (Global.IsViGEmBusInstalled()) {