SEBWIN-359: Fixed freeze during startup or application start by explicitly disabling shell execution when starting a process, as this appears to be the root cause of the freeze on Windows 10 version 1903 and above.

This commit is contained in:
dbuechel 2020-02-12 15:21:12 +01:00
parent 7e3703dc16
commit ad023853d4

View file

@ -63,7 +63,7 @@ namespace SafeExamBrowser.WindowsApi
}
else
{
raw = System.Diagnostics.Process.Start(path, string.Join(" ", args));
raw = StartNormal(path, args);
}
var (name, originalName) = LoadProcessNamesFor(raw);
@ -166,6 +166,16 @@ namespace SafeExamBrowser.WindowsApi
return logger.CloneFor($"{nameof(Process)} '{name}' ({process.Id})");
}
private System.Diagnostics.Process StartNormal(string path, params string[] args)
{
return System.Diagnostics.Process.Start(new ProcessStartInfo
{
Arguments = string.Join(" ", args),
FileName = path,
UseShellExecute = false
});
}
private System.Diagnostics.Process StartOnDesktop(string path, params string[] args)
{
var commandLine = $"{'"' + path + '"'} {string.Join(" ", args)}";