mirror of https://github.com/2dust/v2rayN
Refactor V2rayUpgrade
parent
d03a86292e
commit
d5f1cc99ac
|
@ -234,21 +234,7 @@ namespace ServiceLib.ViewModels
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Locator.Current.GetService<MainWindowViewModel>()?.V2rayUpgrade(fileName);
|
||||||
Process process = new()
|
|
||||||
{
|
|
||||||
StartInfo = new ProcessStartInfo
|
|
||||||
{
|
|
||||||
FileName = "v2rayUpgrade",
|
|
||||||
Arguments = fileName.AppendQuotes(),
|
|
||||||
WorkingDirectory = Utils.StartupPath()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
process.Start();
|
|
||||||
if (process.Id > 0)
|
|
||||||
{
|
|
||||||
Locator.Current.GetService<MainWindowViewModel>()?.MyAppExitAsync(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -428,6 +428,24 @@ namespace ServiceLib.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task V2rayUpgrade(string fileName)
|
||||||
|
{
|
||||||
|
Process process = new()
|
||||||
|
{
|
||||||
|
StartInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = "v2rayUpgrade",
|
||||||
|
Arguments = fileName.AppendQuotes(),
|
||||||
|
WorkingDirectory = Utils.StartupPath()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
process.Start();
|
||||||
|
if (process.Id > 0)
|
||||||
|
{
|
||||||
|
await MyAppExitAsync(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Actions
|
#endregion Actions
|
||||||
|
|
||||||
#region Servers && Groups
|
#region Servers && Groups
|
||||||
|
|
Loading…
Reference in New Issue