More debug info for process start

This commit is contained in:
Jaex 2017-12-18 12:28:28 +03:00
parent 38a8c5d506
commit fed40dd465

View file

@ -119,25 +119,22 @@ public static void CopyAll(DirectoryInfo source, DirectoryInfo target)
public static void Zip(string source, string target)
{
ProcessStartInfo startInfo = new ProcessStartInfo()
{
FileName = Path.GetFullPath(Program.SevenZipPath),
Arguments = $"a -tzip \"{target}\" \"{source}\" -r -mx=9",
UseShellExecute = false,
CreateNoWindow = true
};
Process.Start(startInfo).WaitForExit();
ProcessStart(Path.GetFullPath(Program.SevenZipPath), $"a -tzip \"{target}\" \"{source}\" -r -mx=9");
}
public static void Unzip(string source, string extract)
{
Console.WriteLine("Extracting: " + source);
ProcessStart(Path.GetFullPath(Program.SevenZipPath), $"e \"{source}\" \"{extract}\" -r");
}
private static void ProcessStart(string filePath, string arguments)
{
Console.WriteLine($"Process starting: {filePath} {arguments}");
ProcessStartInfo startInfo = new ProcessStartInfo()
{
FileName = Path.GetFullPath(Program.SevenZipPath),
Arguments = $"e \"{source}\" \"{extract}\" -r",
FileName = filePath,
Arguments = arguments,
UseShellExecute = false,
CreateNoWindow = true
};