File tree Expand file tree Collapse file tree 2 files changed +5
-34
lines changed
BrowserStackLocal/BrowserStackLocal Expand file tree Collapse file tree 2 files changed +5
-34
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,11 @@ static bool IsAlpine()
60
60
string [ ] output = Util . RunShellCommand ( "grep -w 'NAME' /etc/os-release" ) ;
61
61
return output [ 0 ] ? . ToLower ( ) ? . Contains ( "alpine" ) ?? false ;
62
62
}
63
- catch ( System . Exception )
63
+ catch ( System . Exception ex )
64
64
{
65
- return false ;
65
+ Console . WriteLine ( "Exception while check isAlpine " + ex ) ;
66
66
}
67
+ return false ;
67
68
}
68
69
69
70
static string GetBinaryName ( )
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Diagnostics ;
3
- using System . Runtime . InteropServices ;
4
3
5
4
namespace BrowserStack
6
5
{
7
6
public class Util {
8
7
9
- // Ref: https://stackoverflow.com/a/336729
10
- [ DllImport ( "kernel32.dll" , SetLastError = true , CallingConvention = CallingConvention . Winapi ) ]
11
- [ return : MarshalAs ( UnmanagedType . Bool ) ]
12
- private static extern bool IsWow64Process (
13
- [ In ] IntPtr hProcess ,
14
- [ Out ] out bool wow64Process
15
- ) ;
16
-
17
8
// Only Unix Support
18
9
public static string [ ] RunShellCommand ( string command )
19
10
{
@@ -44,34 +35,13 @@ public static string GetUName()
44
35
return osName ;
45
36
}
46
37
38
+ // Using for Linux Only
47
39
public static bool Is64BitOS ( )
48
40
{
49
41
#if NET48_OR_GREATER || NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_0_OR_GREATER
50
42
return Environment . Is64BitOperatingSystem ;
51
43
#endif
52
- bool is64BitProcess = IntPtr . Size == 8 ;
53
- return is64BitProcess || InternalCheckIsWow64 ( ) ;
54
- }
55
-
56
- public static bool InternalCheckIsWow64 ( )
57
- {
58
- if ( ( Environment . OSVersion . Version . Major == 5 && Environment . OSVersion . Version . Minor >= 1 ) ||
59
- Environment . OSVersion . Version . Major >= 6 )
60
- {
61
- using ( Process p = Process . GetCurrentProcess ( ) )
62
- {
63
- bool retVal ;
64
- if ( ! IsWow64Process ( p . Handle , out retVal ) )
65
- {
66
- return false ;
67
- }
68
- return retVal ;
69
- }
70
- }
71
- else
72
- {
73
- return false ;
74
- }
44
+ return true ;
75
45
}
76
46
}
77
47
}
You can’t perform that action at this time.
0 commit comments