Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 5 additions & 30 deletions Knossos.NET/Classes/FsoBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ public async Task<FsoResult> RunFSO(FsoExecType executableType, string cmdline,
}

fso.StartInfo.UseShellExecute = false;
fso.StartInfo.RedirectStandardError = true;
if (workingFolder != null)
fso.StartInfo.WorkingDirectory = workingFolder;
if (Knossos.inPortableMode && Knossos.globalSettings.portableFsoPreferences ||
Expand Down Expand Up @@ -306,30 +305,6 @@ public async Task<FsoResult> RunFSO(FsoExecType executableType, string cmdline,
if (waitForExit)
await fso.WaitForExitAsync();

var stderr = fso.StandardError.ReadToEnd();
if (!string.IsNullOrEmpty(stderr))
{
var errorMsg = $"FSO exited with code {fso.ExitCode}\n\n\nStderr:\n{stderr}";
Log.Add(Log.LogSeverity.Error, "FsoBuild.GetFlagsV1()", errorMsg);

if (KnUtils.IsLinux && stderr.Contains("fuse", StringComparison.OrdinalIgnoreCase))
{
var libfuseError = $"libfuse is missing! FSO AppImages needs fuse to run. Install with:\n" +
"Ubuntu/Debian: sudo apt install libfuse2\n" +
"Fedora: sudo dnf install fuse\n" +
"Arch: sudo pacman -S fuse2";
Log.Add(Log.LogSeverity.Error, "FsoBuild.GetFlagsV1()", libfuseError);
Dispatcher.UIThread.Invoke(new Action(() => { MessageBox.Show(MainWindow.instance, libfuseError, "Unable to run FSO", MessageBox.MessageBoxButtons.OK); }));
}
else
{
Log.Add(Log.LogSeverity.Error, "FsoBuild.GetFlagsV1()", stderr);
Dispatcher.UIThread.Invoke(new Action(() => { MessageBox.Show(MainWindow.instance, stderr, "Unable to run FSO", MessageBox.MessageBoxButtons.OK); }));
}

return new FsoResult(false);
}

return new FsoResult(true);
}
}
Expand Down Expand Up @@ -404,12 +379,13 @@ public async Task<FsoResult> RunFSO(FsoExecType executableType, string cmdline,
output = result;
cmd.WaitForExit();

if (!string.IsNullOrEmpty(stderr) )
if (KnUtils.IsLinux && !string.IsNullOrEmpty(stderr))
{
//Possible missing dependency libs on linux like libfuse for appimage
var errorMsg = $"FSO exited with code {cmd.ExitCode}\n\nStdout:\n{output}\n\nStderr:\n{stderr}";
Log.Add(Log.LogSeverity.Error, "FsoBuild.GetFlagsV1()", errorMsg);

if (KnUtils.IsLinux && (stderr.Contains("fuse", StringComparison.OrdinalIgnoreCase) || output.Contains("fuse", StringComparison.OrdinalIgnoreCase)))
if (stderr.Contains("fuse", StringComparison.OrdinalIgnoreCase) || output.Contains("fuse", StringComparison.OrdinalIgnoreCase))
{
var libfuseError = $"libfuse is missing! FSO AppImages needs fuse to run. Install with:\n" +
"Ubuntu/Debian: sudo apt install libfuse2\n" +
Expand All @@ -419,7 +395,7 @@ public async Task<FsoResult> RunFSO(FsoExecType executableType, string cmdline,
if (!_flagErrorOneWarn)
{
_flagErrorOneWarn = true;
Dispatcher.UIThread.Invoke(new Action(() => { MessageBox.Show(MainWindow.instance, libfuseError, "Unable to run FSO", MessageBox.MessageBoxButtons.OK); }));
Dispatcher.UIThread.Invoke(async () => { await MessageBox.Show(MainWindow.instance, libfuseError, "Unable to run FSO", MessageBox.MessageBoxButtons.OK); });
}
}
else
Expand All @@ -428,10 +404,9 @@ public async Task<FsoResult> RunFSO(FsoExecType executableType, string cmdline,
if (!_flagErrorOneWarn)
{
_flagErrorOneWarn = true;
Dispatcher.UIThread.Invoke(new Action(() => { MessageBox.Show(MainWindow.instance, stderr, "Unable to run FSO", MessageBox.MessageBoxButtons.OK); }));
Dispatcher.UIThread.Invoke(async ()=> { await MessageBox.Show(MainWindow.instance, stderr, "Unable to run FSO", MessageBox.MessageBoxButtons.OK); });
}
}

return null;
}

Expand Down