Skip to content

Commit 7b17ae0

Browse files
committed
If Portable7z has error,show the message.
1 parent ca37ca1 commit 7b17ae0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

MainForm.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,18 @@ private async Task<bool> TryExtractWithPortable7z()
638638
UseShellExecute = false,
639639
CreateNoWindow = true,
640640
RedirectStandardOutput = false,
641-
RedirectStandardError = false
641+
RedirectStandardError = true
642642
};
643643

644644
using (var process = Process.Start(startInfo))
645645
{
646+
var error = await process.StandardError.ReadToEndAsync();
647+
if (!string.IsNullOrEmpty(error))
648+
{
649+
LogMessage($"Portable 7z extraction failed: {Environment.NewLine}{error}");
650+
}
646651
await process.WaitForExitAsync();
647-
return process.ExitCode == 0;
652+
return process.ExitCode == 0 && string.IsNullOrEmpty(error);
648653
}
649654
}
650655
catch (Exception ex)

0 commit comments

Comments
 (0)