From b015c3a3d3e9795cef728b9d5bcd254e1fcd4af0 Mon Sep 17 00:00:00 2001 From: Jeffery Thompson Date: Thu, 11 Oct 2018 17:59:41 -0400 Subject: [PATCH 1/2] feat: deprecate NVRAM, renamed NvramPath to RootConfigPath --- ICD.Common.Utils/PathUtils.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ICD.Common.Utils/PathUtils.cs b/ICD.Common.Utils/PathUtils.cs index 3d473a6..491fbae 100644 --- a/ICD.Common.Utils/PathUtils.cs +++ b/ICD.Common.Utils/PathUtils.cs @@ -26,10 +26,23 @@ namespace ICD.Common.Utils public static string ProgramPath { get { return IcdDirectory.GetApplicationDirectory(); } } /// - /// Gets the path to the NVRAM directory. + /// Gets the path to the root config directory, + /// which contains common and program-specific config directories. /// [PublicAPI] - public static string NvramPath { get { return Join(RootPath, "NVRAM"); } } + public static string RootConfigPath + { + get + { +#if SIMPLSHARP + return Join(RootPath, "USER"); +#elif LINUX + return Join(RootPath, "opt", "ICD.Connect"); +#else + return Join(RootPath, "ProgramData", "ICD.Connect"); +#endif + } + } /// /// Returns the absolute path to the configuration directory. @@ -41,7 +54,7 @@ namespace ICD.Common.Utils get { string directoryName = string.Format("Program{0:D2}Config", ProgramUtils.ProgramNumber); - return Join(NvramPath, directoryName); + return Join(RootConfigPath, directoryName); } } @@ -49,7 +62,7 @@ namespace ICD.Common.Utils /// Returns the absolute path to the common configuration directory. /// [PublicAPI] - public static string CommonConfigPath { get { return Join(NvramPath, "CommonConfig"); } } + public static string CommonConfigPath { get { return Join(RootConfigPath, "CommonConfig"); } } /// /// Returns the absolute path to the common config library directory. From 51dcb41cdfefee810e028eb8a0d209280076466d Mon Sep 17 00:00:00 2001 From: Jeffery Thompson Date: Thu, 25 Oct 2018 15:22:04 -0400 Subject: [PATCH 2/2] feat: make ProgramNumber settable --- ICD.Common.Utils/ProgramUtils.Standard.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ICD.Common.Utils/ProgramUtils.Standard.cs b/ICD.Common.Utils/ProgramUtils.Standard.cs index ff81299..cfbaafc 100644 --- a/ICD.Common.Utils/ProgramUtils.Standard.cs +++ b/ICD.Common.Utils/ProgramUtils.Standard.cs @@ -8,17 +8,11 @@ namespace ICD.Common.Utils { public static partial class ProgramUtils { - /// - /// Gets the program number. - /// - [PublicAPI] - public static uint ProgramNumber - { - get - { - return 1; - } - } + /// + /// Gets the program number. + /// + [PublicAPI] + public static uint ProgramNumber { get; set; } = 1; /// /// Gets the compile date of the program.