More utility tweaks
This commit is contained in:
@@ -72,12 +72,14 @@ namespace OpenRA.Utility
|
|||||||
{
|
{
|
||||||
new ZipInputStream(File.OpenRead(zipFile)).ExtractZip(dest, extracted);
|
new ZipInputStream(File.OpenRead(zipFile)).ExtractZip(dest, extracted);
|
||||||
}
|
}
|
||||||
catch (SharpZipBaseException e)
|
catch (SharpZipBaseException)
|
||||||
{
|
{
|
||||||
foreach(var f in extracted)
|
foreach(var f in extracted)
|
||||||
File.Delete(f);
|
File.Delete(f);
|
||||||
Console.WriteLine("Error: Corrupted archive");
|
Console.WriteLine("Error: Corrupted archive");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("Status: Completed");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DownloadUrl(string argValue)
|
public static void DownloadUrl(string argValue)
|
||||||
@@ -138,9 +140,10 @@ namespace OpenRA.Utility
|
|||||||
Console.WriteLine("Error: Could not find "+file);
|
Console.WriteLine("Error: Could not find "+file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Console.WriteLine("Extracting: {0}", file);
|
Console.WriteLine("Status: Extracting {0}", file);
|
||||||
File.Copy(basePath+file,toPath+Path.GetFileName(file).ToLower(), true);
|
File.Copy(basePath+file,toPath+Path.GetFileName(file).ToLower(), true);
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("Status: Completed");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InstallCncPackages(string path)
|
public static void InstallCncPackages(string path)
|
||||||
@@ -162,9 +165,10 @@ namespace OpenRA.Utility
|
|||||||
Console.WriteLine("Error: Could not find "+file);
|
Console.WriteLine("Error: Could not find "+file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Console.WriteLine("Extracting: {0}", file);
|
Console.WriteLine("Status: Extracting {0}", file);
|
||||||
File.Copy(basePath+file,toPath+Path.GetFileName(file).ToLower(), true);
|
File.Copy(basePath+file,toPath+Path.GetFileName(file).ToLower(), true);
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("Status: Completed");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Settings(string argValue)
|
public static void Settings(string argValue)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace OpenRA.Utility
|
|||||||
using (var sourceStream = FileSystem.Open(s))
|
using (var sourceStream = FileSystem.Open(s))
|
||||||
using (var destStream = File.Create(destFile))
|
using (var destStream = File.Create(destFile))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Extracting: {0}", s);
|
Console.WriteLine("Status: Extracting {0}", s);
|
||||||
destStream.Write(sourceStream.ReadAllBytes());
|
destStream.Write(sourceStream.ReadAllBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ namespace OpenRA.Utility
|
|||||||
{
|
{
|
||||||
if (!entry.IsFile) continue;
|
if (!entry.IsFile) continue;
|
||||||
|
|
||||||
Console.WriteLine("Extracting {0}", entry.Name);
|
Console.WriteLine("Status: Extracting {0}", entry.Name);
|
||||||
if (!Directory.Exists(Path.Combine(destPath, Path.GetDirectoryName(entry.Name))))
|
if (!Directory.Exists(Path.Combine(destPath, Path.GetDirectoryName(entry.Name))))
|
||||||
Directory.CreateDirectory(Path.Combine(destPath, Path.GetDirectoryName(entry.Name)));
|
Directory.CreateDirectory(Path.Combine(destPath, Path.GetDirectoryName(entry.Name)));
|
||||||
var path = destPath + Path.DirectorySeparatorChar + entry.Name;
|
var path = destPath + Path.DirectorySeparatorChar + entry.Name;
|
||||||
|
|||||||
Reference in New Issue
Block a user