-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow mounted TR1 CD (or physical) as installer game file source #1144
Comments
As it's been years since I last had a disk drive, I won't be able to implement this myself. But to anyone who's willing to work on it – the best way to implement it is to create a new |
Example untested patch diff --git a/tools/installer/Installer/Installers/CDRomInstallSource.cs b/tools/installer/Installer/Installers/CDRomInstallSource.cs
new file mode 100644
index 00000000..90f64998
--- /dev/null
+++ b/tools/installer/Installer/Installers/CDRomInstallSource.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+namespace Installer.Installers;
+
+public class CDRomInstallSource : BaseInstallSource
+{
+ public override IEnumerable<string> DirectoriesToTry
+ {
+ get
+ {
+ DriveInfo[] allDrives = DriveInfo.GetDrives();
+ foreach (var drive in allDrives)
+ {
+ if (drive.DriveType == DriveType.CDRom && drive.IsReady) {
+ yield return drive.RootDirectory.FullName;
+ yield return Path.Combine(drive.RootDirectory.FullName, "TOMBENG"); // REMOVE IF NOT NEEDED
+ }
+ }
+ }
+ }
+
+ public override bool IsImportingSavesSupported => false;
+ public override string SourceName => "CDRom";
+
+ public override async Task CopyOriginalGameFiles(
+ string sourceDirectory,
+ string targetDirectory,
+ IProgress<InstallProgress> progress,
+ bool importSaves
+ )
+ {
+ var filterRegex = new Regex(@"(data|fmv|music)[\\/]", RegexOptions.IgnoreCase);
+ await InstallUtils.CopyDirectoryTree(
+ sourceDirectory,
+ targetDirectory,
+ progress,
+ file => filterRegex.IsMatch(file)
+ );
+ }
+
+ public override bool IsDownloadingMusicNeeded(string sourceDirectory)
+ {
+ return true;
+ }
+
+ public override bool IsDownloadingUnfinishedBusinessNeeded(string sourceDirectory)
+ {
+ return true;
+ }
+
+ public override bool IsGameFound(string sourceDirectory)
+ {
+ return Directory.Exists(Path.Combine(sourceDirectory, "DATA"))
+ && Directory.Exists(Path.Combine(sourceDirectory, "FMV"))
+ && File.Exists(Path.Combine(sourceDirectory, "dos4gw.exe"))
+ && File.Exists(Path.Combine(sourceDirectory, "tomb.exe"));
+ }
+}
diff --git a/tools/installer/Installer/Models/SourceStep.cs b/tools/installer/Installer/Models/SourceStep.cs
index 5af1700b..06f5d47c 100644
--- a/tools/installer/Installer/Models/SourceStep.cs
+++ b/tools/installer/Installer/Models/SourceStep.cs
@@ -15,6 +15,7 @@ public class SourceStep : BaseNotifyPropertyChanged, IStep
new InstallSourceViewModel(new GOGInstallSource()),
new InstallSourceViewModel(new TombATIInstallSource()),
new InstallSourceViewModel(new TR1XInstallSource()),
+ new InstallSourceViewModel(new CDRomInstallSource()),
};
foreach (var installationSource in InstallationSources)
diff --git a/tools/installer/Installer/Resources/CDRom.png b/tools/installer/Installer/Resources/CDRom.png
new file mode 100644
index 00000000..32878026
Binary files /dev/null and b/tools/installer/Installer/Resources/CDRom.png differ |
Thanks a lot @rr- . Very much appreciated 🙏, and the icon looks beautiful. In fact all my drives are virtual. I had thought it's a common thing to do among retro gamers, to keep their old games from dying over the decades. |
Adds the ability to install from a physical CD. Removes some additional VS compiler noise. Resolves LostArtefacts#1144.
Adds the ability to install from a physical CD. Removes some additional VS compiler noise. Resolves LostArtefacts#1144.
Adds the ability to install from a physical CD. Removes some additional VS compiler noise. Resolves #1144.
It strikes me as odd that even though you can provide the original CD inserted in your system, none of installer source options support it. I also tried tricking it by providing the CD path as a TR1X or TombATI source, and then when it didn't like that also to the respective
\DATA
on both, but it still doesn't let you proceed.The text was updated successfully, but these errors were encountered: