diff --git a/SubnauticaWatcherInstaller/Installer.cs b/SubnauticaWatcherInstaller/Installer.cs index 586fc02..ece1ba4 100644 --- a/SubnauticaWatcherInstaller/Installer.cs +++ b/SubnauticaWatcherInstaller/Installer.cs @@ -23,12 +23,13 @@ internal class Installer internal Installer(MessageCallback log) { this.log = log; + SubnauticaPath = Path.Combine(SteamPath, @"steamapps\common\Subnautica"); } private string SteamPath => Registry.GetValue(@"HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath", null) as string; - private string SubnauticaPath => Path.Combine(SteamPath, @"steamapps\common\Subnautica"); + public string SubnauticaPath { get; set; } private string SubnauticaManagedPath => Path.Combine(SubnauticaPath, @"Subnautica_Data\Managed"); diff --git a/SubnauticaWatcherInstaller/mainForm.cs b/SubnauticaWatcherInstaller/mainForm.cs index e136d8e..39d810a 100644 --- a/SubnauticaWatcherInstaller/mainForm.cs +++ b/SubnauticaWatcherInstaller/mainForm.cs @@ -4,6 +4,7 @@ using System; using System.Drawing; + using System.IO; using System.Reflection; using System.Windows.Forms; using NLog; @@ -24,7 +25,27 @@ public MainForm() Installer = new Installer(Log); // Disable buttons if paths invalid - if (Installer.ValidatePaths() == 0) return; + if (Installer.ValidatePaths() != 0) + { + if (!Directory.Exists(Installer.SubnauticaPath)) + { + var dialog = new FolderBrowserDialog + { + RootFolder = Environment.SpecialFolder.MyComputer, + Description = @"Your Subnautica folder is not in the default Steam Library. +Please select your Subnautica install folder (something like: \steamapps\common\Subnautica) +" + }; + var result = dialog.ShowDialog(); + if (result == DialogResult.OK) + { + Installer.SubnauticaPath = dialog.SelectedPath; + Log($"User Selected Path: {Installer.SubnauticaPath}"); + return; + } + Log("Error: User aborted path selection."); + } + } installButton.Enabled = false; uninstallButton.Enabled = false; } diff --git a/appveyor.yml b/appveyor.yml index 2b31c96..aaa6164 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ image: Visual Studio 2017 -version: '0.6' +version: '0.7' install: # Node on appveyor is too old diff --git a/readme.md b/readme.md index e1c1759..8d900a6 100644 --- a/readme.md +++ b/readme.md @@ -28,6 +28,7 @@ This mod is my personal answer to not having an in-game map. I'm making it avail * v0.4 - Day / Night indicator * v0.5 - Leviathan Spawns now in their own layer. * v0.6 - Now able to automatically switch to correct base layer (e.g. Lost River, Lava Zone) +* v0.7 - Installer now handles cases where Subnautica is not in the default Steam library. __Caveats:__ Background images and additional overlay data taken from Wiki and may be out-of-date. diff --git a/version.json b/version.json index 14a4d89..383a12e 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.6", + "version": "0.7", "assemblyVersion": { "precision": "build" },