From 52c9fe506f8ad3eda22330651a04083b63f36d55 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Fri, 31 Aug 2018 08:54:54 -0600 Subject: [PATCH] More detection fixes for issue #149 --- GBM/Managers/mgrProcessDetection.vb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/GBM/Managers/mgrProcessDetection.vb b/GBM/Managers/mgrProcessDetection.vb index 44dd103..3a11d11 100644 --- a/GBM/Managers/mgrProcessDetection.vb +++ b/GBM/Managers/mgrProcessDetection.vb @@ -218,14 +218,13 @@ Public Class mgrProcessDetection 'Unix Handler 'We need some special handling for Wine processes If mgrCommon.IsUnix And (sProcessCheck.ToLower = "wine-preloader" Or sProcessCheck.ToLower = "wine64-preloader") Then - Dim sWinePath As String() = GetUnixProcessArguments(prsCurrent) - 'The wine-preloader parameters can refer to a path on the host system or a windows based path within in the prefix, we need to handle both. - If sWinePath(0).Contains("\") Then - sWinePath = GetUnixProcessArguments(prsCurrent)(0).Split("\") - ElseIf sWinePath(0).Contains("/") Then - sWinePath = GetUnixProcessArguments(prsCurrent)(0).Split("/") - End If - sProcessCheck = sWinePath(sWinePath.Length - 1).Replace(".exe", "") + Dim sArgs As String() = GetUnixProcessArguments(prsCurrent) + Dim sParameter As String + Dim sWinePath As String() + 'The wine-preloader parameters can refer to a path on the host system, windows based path within in the prefix, or mixed notation. + sParameter = sArgs(0).Replace("\", "/") + sWinePath = sParameter.Split("/") + sProcessCheck = Path.GetFileNameWithoutExtension(sWinePath(sWinePath.Length - 1)) bWineProcess = True Else bWineProcess = False