Comments (3)
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 InstallSource
in the Installers
namespace, such as GOGInstallSource
or SteamInstallSource
. It shouldn't hardcode the D:\
drive and instead use windows APIs to get the first disk drive (https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.getdrives?view=net-8.0 + System.IO.DriveType.CDRom
).
from tr1x.
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
from tr1x.
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.
from tr1x.
Related Issues (20)
- Slow performance on Apple Silicon, draw distance related? (M2 Pro Macbook Pro) HOT 1
- Include PS1 FMVs in installer? HOT 2
- Feature request: Add option for faster pickup animation from TR4+
- Please add support for older MacOS versions HOT 1
- TR1X bug: Console command to enable 30/60 FPS on Main Menu, also triggers Demo Mode
- TR1X bug: FPS counter overlaps with the health bar when in Demo Mode
- TR1X bug: Demo 1 desync if fix bear AI enabled HOT 5
- Troubles when building TR1X HOT 2
- Game can crash with more than 16 savegame slots HOT 2
- Feature request: Add TR4+ ability to shimmy around corners HOT 2
- TR1X bug: Blinking text discrepancy - 30/60 FPS HOT 3
- Add unobtainable secrets gameflow property
- OG bug: shooting the scion with the shotgun is difficult
- TR1X bug: Lightning transparency issue HOT 1
- TR1X bug: First backdrop flicker during fade-in when starting up the game HOT 5
- Add Backflip 180 ("Arabian") from early demos
- TR1X bug: Small lightning bolts is absent
- Savegame slots over 64 are unusable
- TR1X bug: game crashes with large rooms
- TR1X bug: Issue with console command to load specific levels HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tr1x.