Rename v2rayUpgrade 2 AmazTool

This commit is contained in:
2dust
2024-10-09 20:13:25 +08:00
parent fea7c9fbd7
commit 3c45ef624a
8 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -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()
@@ -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
{
@@ -235,7 +235,7 @@ namespace ServiceLib.ViewModels
{
return;
}
Locator.Current.GetService<MainWindowViewModel>()?.V2rayUpgrade(fileName);
Locator.Current.GetService<MainWindowViewModel>()?.UpgradeApp(fileName);
}
catch (Exception ex)
{
@@ -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()
}