Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Commit

Permalink
Updated installer to support subnautics in alternate locations
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSGill committed Dec 3, 2017
1 parent 331365f commit 102d9fd
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
3 changes: 2 additions & 1 deletion SubnauticaWatcherInstaller/Installer.cs
Expand Up @@ -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");

Expand Down
23 changes: 22 additions & 1 deletion SubnauticaWatcherInstaller/mainForm.cs
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using NLog;
Expand All @@ -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: <steamlibrary>\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;
}
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
@@ -1,6 +1,6 @@
image: Visual Studio 2017

version: '0.6'
version: '0.7'

install:
# Node on appveyor is too old
Expand Down
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion 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"
},
Expand Down

0 comments on commit 102d9fd

Please sign in to comment.