summaryrefslogtreecommitdiff
path: root/src/SMAPI.Installer/Framework/InstallerPaths.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-08-14 12:21:40 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-08-14 12:21:40 -0400
commit4f28ea33bd7cc65485402c5e85259083e86b49e1 (patch)
tree86c4d8f9272de9a715cfcbf4008f0c09f5a59a21 /src/SMAPI.Installer/Framework/InstallerPaths.cs
parent60b41195778af33fd609eab66d9ae3f1d1165e8f (diff)
parent4dd4efc96fac6a7ab66c14edead10e4fa988040d (diff)
downloadSMAPI-4f28ea33bd7cc65485402c5e85259083e86b49e1.tar.gz
SMAPI-4f28ea33bd7cc65485402c5e85259083e86b49e1.tar.bz2
SMAPI-4f28ea33bd7cc65485402c5e85259083e86b49e1.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Installer/Framework/InstallerPaths.cs')
-rw-r--r--src/SMAPI.Installer/Framework/InstallerPaths.cs61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/SMAPI.Installer/Framework/InstallerPaths.cs b/src/SMAPI.Installer/Framework/InstallerPaths.cs
new file mode 100644
index 00000000..d212876a
--- /dev/null
+++ b/src/SMAPI.Installer/Framework/InstallerPaths.cs
@@ -0,0 +1,61 @@
+using System.IO;
+
+namespace StardewModdingAPI.Installer.Framework
+{
+ /// <summary>Manages paths for the SMAPI installer.</summary>
+ internal class InstallerPaths
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The directory containing the installer files for the current platform.</summary>
+ public DirectoryInfo PackageDir { get; }
+
+ /// <summary>The directory containing the installed game.</summary>
+ public DirectoryInfo GameDir { get; }
+
+ /// <summary>The directory into which to install mods.</summary>
+ public DirectoryInfo ModsDir { get; }
+
+ /// <summary>The full path to the directory containing the installer files for the current platform.</summary>
+ public string PackagePath => this.PackageDir.FullName;
+
+ /// <summary>The full path to the directory containing the installed game.</summary>
+ public string GamePath => this.GameDir.FullName;
+
+ /// <summary>The full path to the directory into which to install mods.</summary>
+ public string ModsPath => this.ModsDir.FullName;
+
+ /// <summary>The full path to the installed SMAPI executable file.</summary>
+ public string ExecutablePath { get; }
+
+ /// <summary>The full path to the vanilla game launcher on Linux/Mac.</summary>
+ public string UnixLauncherPath { get; }
+
+ /// <summary>The full path to the installed SMAPI launcher on Linux/Mac before it's renamed.</summary>
+ public string UnixSmapiLauncherPath { get; }
+
+ /// <summary>The full path to the vanilla game launcher on Linux/Mac after SMAPI is installed.</summary>
+ public string UnixBackupLauncherPath { get; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="packageDir">The directory path containing the installer files for the current platform.</param>
+ /// <param name="gameDir">The directory path for the installed game.</param>
+ /// <param name="gameExecutableName">The name of the game's executable file for the current platform.</param>
+ public InstallerPaths(DirectoryInfo packageDir, DirectoryInfo gameDir, string gameExecutableName)
+ {
+ this.PackageDir = packageDir;
+ this.GameDir = gameDir;
+ this.ModsDir = new DirectoryInfo(Path.Combine(gameDir.FullName, "Mods"));
+
+ this.ExecutablePath = Path.Combine(gameDir.FullName, gameExecutableName);
+ this.UnixLauncherPath = Path.Combine(gameDir.FullName, "StardewValley");
+ this.UnixSmapiLauncherPath = Path.Combine(gameDir.FullName, "StardewModdingAPI");
+ this.UnixBackupLauncherPath = Path.Combine(gameDir.FullName, "StardewValley-original");
+ }
+ }
+}