Fix ProcUtils NoAssociatedProcess issue

This commit is contained in:
2dust 2025-02-04 10:30:33 +08:00
parent bccab41c8f
commit e986dc189e

View file

@ -24,18 +24,18 @@ public static class ProcUtils
if (arguments.Contains(' '))
arguments = arguments.AppendQuotes();
Process process = new()
Process proc = new()
{
StartInfo = new ProcessStartInfo
{
UseShellExecute = true,
FileName = fileName,
Arguments = arguments,
WorkingDirectory = dir
WorkingDirectory = dir ?? string.Empty
}
};
process.Start();
return process.Id;
proc.Start();
return dir is null ? null : proc.Id;
}
catch (Exception ex)
{