Browse Source

bug fix

pull/4711/head
2dust 10 months ago
parent
commit
bd838094cd
  1. 10
      v2rayN/v2rayN/Common/StringEx.cs
  2. 4
      v2rayN/v2rayN/Handler/UpdateHandle.cs
  3. 2
      v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs

10
v2rayN/v2rayN/Common/StringEx.cs

@ -80,5 +80,15 @@ namespace v2rayN
return char.ToUpper(value[0]) + value.Substring(1);
}
public static string AppendQuotes(this string value)
{
if (string.IsNullOrEmpty(value))
{
return string.Empty;
}
return $"\"{value}\"";
}
}
}

4
v2rayN/v2rayN/Handler/UpdateHandle.cs

@ -54,7 +54,7 @@ namespace v2rayN.Handler
StartInfo = new ProcessStartInfo
{
FileName = "v2rayUpgrade.exe",
Arguments = $"\"{fileName}\"",
Arguments = fileName.AppendQuotes(),
WorkingDirectory = Utils.StartupPath()
}
};
@ -364,7 +364,7 @@ namespace v2rayN.Handler
}
using Process p = new();
p.StartInfo.FileName = filePath;
p.StartInfo.FileName = filePath.AppendQuotes();
p.StartInfo.Arguments = coreInfo.versionArg;
p.StartInfo.WorkingDirectory = Utils.StartupPath();
p.StartInfo.UseShellExecute = false;

2
v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs

@ -1388,7 +1388,7 @@ namespace v2rayN.ViewModels
UseShellExecute = true,
Arguments = Global.RebootAs,
WorkingDirectory = Utils.StartupPath(),
FileName = Utils.GetExePath(),
FileName = Utils.GetExePath().AppendQuotes(),
Verb = "runas",
};
try

Loading…
Cancel
Save