try-catch the process.start and do it on another thread

This commit is contained in:
Elijah R 2023-12-04 12:36:10 -05:00
parent e48ce2f9cf
commit 931b866ea9

View file

@ -68,7 +68,15 @@ namespace CollabVMAgent
#if DEBUG
Console.WriteLine($"Successfully wrote {msg.Filename} ({msg.FileData.Length} bytes)");
#endif
Process.Start(UploadsFolder + @"\" + msg.Filename);
try
{
new Thread(() => Process.Start(UploadsFolder + @"\" + msg.Filename)).Start();
} catch (Exception ex)
{
#if DEBUG
Console.WriteLine($"Failed to run {msg.Filename}: {ex.Message}");
#endif
}
break;
}
}