From aab91cb37ea27c60c0b08ee7d3ac2d97d9a0c712 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 14 Sep 2016 21:48:40 +0100 Subject: [PATCH] Work around incorrect mono behaviour under OSX. --- .../Logic/Installation/InstallFromDiscLogic.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs index e3d0678519..db553d3108 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs @@ -96,6 +96,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic DetectContentDisks(); } + static bool IsValidDrive(DriveInfo d) + { + if (d.DriveType == DriveType.CDRom && d.IsReady) + return true; + + // HACK: the "TFD" DVD is detected as a fixed udf-formatted drive on OSX + if (d.DriveType == DriveType.Fixed && d.DriveFormat == "udf") + return true; + + return false; + } + void DetectContentDisks() { var message = "Detecting drives"; @@ -105,7 +117,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic new Task(() => { var volumes = DriveInfo.GetDrives() - .Where(v => v.DriveType == DriveType.CDRom && v.IsReady) + .Where(IsValidDrive) .Select(v => v.RootDirectory.FullName); foreach (var kv in sources)