Fix #171
This commit is contained in:
+5
-13
@@ -292,22 +292,14 @@ Public Class mgrPath
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function GetWinePrefix(ByVal prs As Process) As String
|
Public Shared Function GetWinePrefix(ByVal prs As Process) As String
|
||||||
Dim prps As Process
|
Dim sEnv As String
|
||||||
Dim sPsinfo As String
|
Dim oParse As New Regex("WINEPREFIX=.+?(?=\x00)")
|
||||||
Dim oParse As New Regex("WINEPREFIX=.+?(?= )")
|
|
||||||
Dim oMatch As Match
|
Dim oMatch As Match
|
||||||
|
|
||||||
Try
|
Try
|
||||||
prps = New Process
|
sEnv = File.ReadAllText("/proc/" & prs.Id.ToString() & "/environ")
|
||||||
prps.StartInfo.FileName = "/bin/ps"
|
If oParse.IsMatch(sEnv) Then
|
||||||
prps.StartInfo.Arguments = "e " & prs.Id.ToString
|
oMatch = oParse.Match(sEnv)
|
||||||
prps.StartInfo.UseShellExecute = False
|
|
||||||
prps.StartInfo.RedirectStandardOutput = True
|
|
||||||
prps.StartInfo.CreateNoWindow = True
|
|
||||||
prps.Start()
|
|
||||||
sPsinfo = prps.StandardOutput.ReadToEnd()
|
|
||||||
If oParse.IsMatch(sPsinfo) Then
|
|
||||||
oMatch = oParse.Match(sPsinfo)
|
|
||||||
Return oMatch.Value.Trim("/").Split("=")(1)
|
Return oMatch.Value.Trim("/").Split("=")(1)
|
||||||
Else
|
Else
|
||||||
'When WINEPREFIX is not part of the command, we will assume the default prefix.
|
'When WINEPREFIX is not part of the command, we will assume the default prefix.
|
||||||
|
|||||||
Reference in New Issue
Block a user