mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 11:59:13 +00:00
Update Utils.cs
This commit is contained in:
parent
3862f6c97c
commit
329a46ab9c
1 changed files with 0 additions and 30 deletions
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace AmazTool;
|
||||
|
||||
|
@ -51,31 +48,4 @@ internal class Utils
|
|||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsPackagedInstall()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (OperatingSystem.IsWindows() || OperatingSystem.IsMacOS())
|
||||
return false;
|
||||
|
||||
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPIMAGE")))
|
||||
return true;
|
||||
|
||||
var sp = StartupPath()?.Replace('\\', '/');
|
||||
if (!string.IsNullOrEmpty(sp) && sp.StartsWith("/opt/v2rayN", StringComparison.Ordinal))
|
||||
return true;
|
||||
|
||||
var procPath = Environment.ProcessPath;
|
||||
var procDir = string.IsNullOrEmpty(procPath)
|
||||
? ""
|
||||
: Path.GetDirectoryName(procPath)?.Replace('\\', '/');
|
||||
if (!string.IsNullOrEmpty(procDir) && procDir.StartsWith("/opt/v2rayN", StringComparison.Ordinal))
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue