diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index f839c58..ca0be18 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -1927,8 +1927,8 @@ Public Class frmMain End If If bWineProcess Then - 'Attempt a path conversion if the game configuration is using an absolute windows path - If oProcess.GameInfo.AbsolutePath And oProcess.GameInfo.TruePath.Contains("\") Then + 'Attempt a path conversion if the game configuration is using an absolute windows path that we can convert + If mgrVariables.CheckForReservedVariables(oProcess.GameInfo.TruePath) Then Dim sWinePrefix As String = mgrPath.GetWinePrefix(oProcess.FoundProcess) Dim sWineSavePath As String If Not sWinePrefix = String.Empty Then @@ -1936,6 +1936,7 @@ Public Class frmMain sWineSavePath = mgrPath.GetWineSavePath(sWinePrefix, oProcess.GameInfo.TruePath) If Not sWineSavePath = oProcess.GameInfo.TruePath Then oProcess.GameInfo.TruePath = sWineSavePath + oProcess.GameInfo.AbsolutePath = True UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, New String() {oProcess.GameInfo.Name, sWineSavePath}), False) End If End If diff --git a/GBM/Managers/mgrVariables.vb b/GBM/Managers/mgrVariables.vb index 72befd2..2198cbd 100644 --- a/GBM/Managers/mgrVariables.vb +++ b/GBM/Managers/mgrVariables.vb @@ -166,4 +166,17 @@ Return oList End Function + + Public Shared Function CheckForReservedVariables(ByVal sPath As String) As Boolean + Dim s As String + + For Each s In GetReservedVariables() + s = "%" & s & "%" + If sPath.Contains(s) Then + Return True + End If + Next + + Return False + End Function End Class