SEBWIN-392: Forgot to actually use the arguments of a whitelisted application.

This commit is contained in:
Damian Büchel 2020-04-29 18:15:50 +02:00
parent bdc8dad413
commit 631fb583d7

View file

@ -80,7 +80,7 @@ namespace SafeExamBrowser.Applications
try
{
logger.Info("Starting application...");
InitializeInstance(processFactory.StartNew(executablePath));
InitializeInstance(processFactory.StartNew(executablePath, BuildArguments()));
logger.Info("Successfully started application.");
}
catch (Exception e)
@ -89,6 +89,18 @@ namespace SafeExamBrowser.Applications
}
}
private string[] BuildArguments()
{
var arguments = new List<string>();
foreach (var argument in settings.Arguments)
{
arguments.Add(Environment.ExpandEnvironmentVariables(argument));
}
return arguments.ToArray();
}
public void Terminate()
{
applicationMonitor.InstanceStarted -= ApplicationMonitor_InstanceStarted;