From 0c4e5cf063b718cf851b7e86b8085a1a8c7ac8e4 Mon Sep 17 00:00:00 2001 From: kusomaigo Date: Sat, 20 May 2023 12:13:43 -0700 Subject: [PATCH] use system environment variable for Appdata and Appdata/LocalLow paths instead of using Environment.SpecialFolder --- VRCFaceTracking.Core/Utils.cs | 2 +- VRCFaceTracking.Core/VRChat.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/VRCFaceTracking.Core/Utils.cs b/VRCFaceTracking.Core/Utils.cs index 737d3f4a..158050e5 100644 --- a/VRCFaceTracking.Core/Utils.cs +++ b/VRCFaceTracking.Core/Utils.cs @@ -33,7 +33,7 @@ public static class Utils public static readonly bool HasAdmin = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); - public static readonly string PersistentDataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "VRCFaceTracking"); + public static readonly string PersistentDataDirectory = Path.Combine(Environment.GetEnvironmentVariable("appdata"), "VRCFaceTracking"); public static readonly string CustomLibsDirectory = PersistentDataDirectory + "\\CustomLibs"; } } \ No newline at end of file diff --git a/VRCFaceTracking.Core/VRChat.cs b/VRCFaceTracking.Core/VRChat.cs index 7a232c5e..4b8642fe 100644 --- a/VRCFaceTracking.Core/VRChat.cs +++ b/VRCFaceTracking.Core/VRChat.cs @@ -5,8 +5,7 @@ namespace VRCFaceTracking.Core { public static class VRChat { - public static readonly string VRCData = Path.Combine(Environment - .GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", "LocalLow"), "VRChat\\VRChat"); + public static readonly string VRCData = Path.Combine($"{Environment.GetEnvironmentVariable("localappdata")}Low", "VRChat\\VRChat"); public static readonly string VRCOSCDirectory = Path.Combine(VRCData, "OSC");