Skip to content

Commit

Permalink
Rename v2rayUpgrade 2 AmazTool
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 9, 2024
1 parent fea7c9f commit 3c45ef6
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions v2rayN/v2rayUpgrade/Program.cs → v2rayN/AmazTool/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace v2rayUpgrade
namespace AmazTool
{
internal static class Program
{
Expand All @@ -16,7 +16,7 @@ private static void Main(string[] args)
}

var fileName = Uri.UnescapeDataString(string.Join(" ", args));
Upgrade.UpgradeApp(fileName);
UpgradeApp.Upgrade(fileName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
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...(正在进行中,请等待)");
Expand Down Expand Up @@ -105,7 +105,7 @@ public static void UpgradeApp(string fileName)

private static string GetExePath()
{
return Environment.ProcessPath ?? string.Empty;
return Environment.ProcessPath ?? Process.GetCurrentProcess().MainModule?.FileName ?? string.Empty;
}

private static string StartupPath()
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Common/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ public static string GetPath(string fileName)
/// <returns></returns>
public static string GetExePath()
{
return Environment.ProcessPath ?? string.Empty;
return Environment.ProcessPath ?? Process.GetCurrentProcess().MainModule?.FileName ?? string.Empty;
}

public static string StartupPath()
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public async Task LocalRestore(string fileName)
var result = await CreateZipFileFromDirectory(fileBackup);
if (result)
{
Locator.Current.GetService<MainWindowViewModel>()?.V2rayUpgrade(fileName);
Locator.Current.GetService<MainWindowViewModel>()?.UpgradeApp(fileName);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private void UpgradeN()
{
return;
}
Locator.Current.GetService<MainWindowViewModel>()?.V2rayUpgrade(fileName);
Locator.Current.GetService<MainWindowViewModel>()?.UpgradeApp(fileName);
}
catch (Exception ex)
{
Expand Down
4 changes: 2 additions & 2 deletions v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,13 @@ public async Task MyAppExitAsync(bool blWindowsShutDown)
}
}

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()
}
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c45ef6

Please sign in to comment.