Installing from CD: Volume names / mount points are unreliable identifiers - check for specific files on the disk instead.

This commit is contained in:
Paul Chote
2011-07-23 16:12:08 +12:00
parent a165a80101
commit 22d3e16225
4 changed files with 18 additions and 7 deletions

View File

@@ -49,7 +49,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
void CheckForDisk()
{
var path = InstallUtils.GetMountedDisk(new [] { "CD1", "CD2" });
Func<string, bool> ValidDiskFilter = diskRoot => File.Exists(diskRoot+Path.DirectorySeparatorChar+"MAIN.MIX") &&
File.Exists(new string[] { diskRoot, "INSTALL", "REDALERT.MIX" }.Aggregate(Path.Combine));
var path = InstallUtils.GetMountedDisk(ValidDiskFilter);
if (path != null)
Install(path);