mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-20 07:14:40 +00:00
Compare commits
No commits in common. "2b5cbb5e74d2fc629332fa8eb984a807e8042a1a" and "a6e246948a85514ea6fc68e43ba2cb603e7fc493" have entirely different histories.
2b5cbb5e74
...
a6e246948a
3 changed files with 10 additions and 36 deletions
|
@ -529,9 +529,15 @@ namespace ServiceLib.Common
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return blFull
|
if (blFull)
|
||||||
? $"{Global.AppName} - V{GetVersionInfo()} - {RuntimeInformation.ProcessArchitecture} - {StartupPath()}"
|
{
|
||||||
: $"{Global.AppName}/{GetVersionInfo()}";
|
return
|
||||||
|
$"{Global.AppName} - V{GetVersionInfo()} - {RuntimeInformation.ProcessArchitecture} - {File.GetLastWriteTime(GetExePath()):yyyy/MM/dd}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $"{Global.AppName}/{GetVersionInfo()}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -671,27 +677,6 @@ namespace ServiceLib.Common
|
||||||
|
|
||||||
#region TempPath
|
#region TempPath
|
||||||
|
|
||||||
public static bool HasWritePermission()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var tempPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "guiTemps");
|
|
||||||
if (!Directory.Exists(tempPath))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(tempPath);
|
|
||||||
}
|
|
||||||
var fileName = Path.Combine(tempPath, GetGuid());
|
|
||||||
File.Create(fileName).Close();
|
|
||||||
File.Delete(fileName);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetPath(string fileName)
|
public static string GetPath(string fileName)
|
||||||
{
|
{
|
||||||
var startupPath = StartupPath();
|
var startupPath = StartupPath();
|
||||||
|
@ -710,11 +695,6 @@ namespace ServiceLib.Common
|
||||||
|
|
||||||
public static string StartupPath()
|
public static string StartupPath()
|
||||||
{
|
{
|
||||||
if (Utils.IsLinux() && Environment.GetEnvironmentVariable("V2RAYN_LOCAL_APPLICATION_DATA") == "1")
|
|
||||||
{
|
|
||||||
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "v2rayN");
|
|
||||||
}
|
|
||||||
|
|
||||||
return AppDomain.CurrentDomain.BaseDirectory;
|
return AppDomain.CurrentDomain.BaseDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -872,7 +852,6 @@ namespace ServiceLib.Common
|
||||||
public static async Task<string?> SetLinuxChmod(string? fileName)
|
public static async Task<string?> SetLinuxChmod(string? fileName)
|
||||||
{
|
{
|
||||||
if (fileName.IsNullOrEmpty()) return null;
|
if (fileName.IsNullOrEmpty()) return null;
|
||||||
//File.SetUnixFileMode(fileName, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
|
|
||||||
var arg = new List<string>() { "-c", $"chmod +x {fileName}" };
|
var arg = new List<string>() { "-c", $"chmod +x {fileName}" };
|
||||||
return await GetCliWrapOutput("/bin/bash", arg);
|
return await GetCliWrapOutput("/bin/bash", arg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,11 +46,6 @@
|
||||||
|
|
||||||
public bool InitApp()
|
public bool InitApp()
|
||||||
{
|
{
|
||||||
if (Utils.IsLinux() && Utils.HasWritePermission() == false)
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("V2RAYN_LOCAL_APPLICATION_DATA", "1", EnvironmentVariableTarget.Process);
|
|
||||||
}
|
|
||||||
|
|
||||||
Logging.Setup();
|
Logging.Setup();
|
||||||
var config = ConfigHandler.LoadConfig();
|
var config = ConfigHandler.LoadConfig();
|
||||||
if (config == null)
|
if (config == null)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>7.4.0</Version>
|
<Version>7.3.2</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Reference in a new issue