Browse Source

Rename v2rayUpgrade 2 AmazTool

pull/5829/head
2dust 1 month ago
parent
commit
3c45ef624a
  1. 0
      v2rayN/AmazTool/AmazTool.csproj
  2. 4
      v2rayN/AmazTool/Program.cs
  3. 8
      v2rayN/AmazTool/UpgradeApp.cs
  4. 2
      v2rayN/ServiceLib/Common/Utils.cs
  5. 2
      v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs
  6. 2
      v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs
  7. 4
      v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs
  8. 2
      v2rayN/v2rayN.sln

0
v2rayN/v2rayUpgrade/v2rayUpgrade.csproj → v2rayN/AmazTool/AmazTool.csproj

4
v2rayN/v2rayUpgrade/Program.cs → v2rayN/AmazTool/Program.cs

@ -1,4 +1,4 @@
namespace v2rayUpgrade
namespace AmazTool
{
internal static class Program
{
@ -16,7 +16,7 @@
}
var fileName = Uri.UnescapeDataString(string.Join(" ", args));
Upgrade.UpgradeApp(fileName);
UpgradeApp.Upgrade(fileName);
}
}
}

8
v2rayN/v2rayUpgrade/Upgrade.cs → v2rayN/AmazTool/UpgradeApp.cs

@ -3,11 +3,11 @@ using System.IO.Compression;
using System.Runtime.InteropServices;
using System.Text;
namespace v2rayUpgrade
namespace AmazTool
{
internal class Upgrade
internal class UpgradeApp
{
public static void UpgradeApp(string fileName)
public static void Upgrade(string fileName)
{
Console.WriteLine(fileName);
Console.WriteLine("In progress, please wait...(正在进行中,请等待)");
@ -105,7 +105,7 @@ namespace v2rayUpgrade
private static string GetExePath()
{
return Environment.ProcessPath ?? string.Empty;
return Environment.ProcessPath ?? Process.GetCurrentProcess().MainModule?.FileName ?? string.Empty;
}
private static string StartupPath()

2
v2rayN/ServiceLib/Common/Utils.cs

@ -750,7 +750,7 @@ namespace ServiceLib.Common
/// <returns></returns>
public static string GetExePath()
{
return Environment.ProcessPath ?? string.Empty;
return Environment.ProcessPath ?? Process.GetCurrentProcess().MainModule?.FileName ?? string.Empty;
}
public static string StartupPath()

2
v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs

@ -137,7 +137,7 @@ namespace ServiceLib.ViewModels
var result = await CreateZipFileFromDirectory(fileBackup);
if (result)
{
Locator.Current.GetService<MainWindowViewModel>()?.V2rayUpgrade(fileName);
Locator.Current.GetService<MainWindowViewModel>()?.UpgradeApp(fileName);
}
else
{

2
v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs

@ -235,7 +235,7 @@ namespace ServiceLib.ViewModels
{
return;
}
Locator.Current.GetService<MainWindowViewModel>()?.V2rayUpgrade(fileName);
Locator.Current.GetService<MainWindowViewModel>()?.UpgradeApp(fileName);
}
catch (Exception ex)
{

4
v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs

@ -437,13 +437,13 @@ namespace ServiceLib.ViewModels
}
}
public async Task V2rayUpgrade(string fileName)
public async Task UpgradeApp(string fileName)
{
Process process = new()
{
StartInfo = new ProcessStartInfo
{
FileName = "v2rayUpgrade",
FileName = "AmazTool",
Arguments = fileName.AppendQuotes(),
WorkingDirectory = Utils.StartupPath()
}

2
v2rayN/v2rayN.sln

@ -13,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceLib", "ServiceLib\Se
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "v2rayN.Desktop", "v2rayN.Desktop\v2rayN.Desktop.csproj", "{5D16541A-F971-4C17-9315-BB8955E3F984}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "v2rayUpgrade", "v2rayUpgrade\v2rayUpgrade.csproj", "{47D68B1C-601C-4C69-873B-FFF0DC13EC97}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AmazTool", "AmazTool\AmazTool.csproj", "{47D68B1C-601C-4C69-873B-FFF0DC13EC97}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Loading…
Cancel
Save