Autodetect CD instead of prompting the user. Fixes #911. Requires testing under Windows and Linux.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using ICSharpCode.SharpZipLib;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
|
||||
@@ -26,6 +27,15 @@ namespace OpenRA.FileFormats
|
||||
if (e != null) yield return e; else break;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetMountedDisk(string[] volumeNames)
|
||||
{
|
||||
var volumes = DriveInfo.GetDrives()
|
||||
.Where(v => v.DriveType == DriveType.CDRom && v.IsReady)
|
||||
.Select(v => v.RootDirectory.FullName);
|
||||
|
||||
return volumes.FirstOrDefault(v => volumeNames.Contains(Path.GetFileName(v)));
|
||||
}
|
||||
|
||||
// TODO: The package should be mounted into its own context to avoid name collisions with installed files
|
||||
public static bool ExtractFromPackage(string srcPath, string package, string[] files, string destPath, Action<string> onProgress, Action<string> onError)
|
||||
|
||||
Reference in New Issue
Block a user