Fix ProcUtils NoAssociatedProcess issue
This commit is contained in:
@@ -24,18 +24,18 @@ public static class ProcUtils
|
|||||||
if (arguments.Contains(' '))
|
if (arguments.Contains(' '))
|
||||||
arguments = arguments.AppendQuotes();
|
arguments = arguments.AppendQuotes();
|
||||||
|
|
||||||
Process process = new()
|
Process proc = new()
|
||||||
{
|
{
|
||||||
StartInfo = new ProcessStartInfo
|
StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
UseShellExecute = true,
|
UseShellExecute = true,
|
||||||
FileName = fileName,
|
FileName = fileName,
|
||||||
Arguments = arguments,
|
Arguments = arguments,
|
||||||
WorkingDirectory = dir
|
WorkingDirectory = dir ?? string.Empty
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
process.Start();
|
proc.Start();
|
||||||
return process.Id;
|
return dir is null ? null : proc.Id;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user