app-emulation/86BoxManagerX: fix ebuild

Signed-off-by: Gonçalo Duarte <gonegrier.duarte@gmail.com>
This commit is contained in:
Gonçalo Duarte
2023-11-05 17:02:32 +00:00
parent 826b70ba01
commit d7a5394b48
2 changed files with 64 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
diff --git a/86BoxManager.Core/Registry/Configs.cs b/86BoxManager.Core/Registry/Configs.cs
index c61e99a..be25067 100644
--- a/86BoxManager.Core/Registry/Configs.cs
+++ b/86BoxManager.Core/Registry/Configs.cs
@@ -1,3 +1,4 @@
+using System;
using System.IO;
using System.Text;
using Newtonsoft.Json;
@@ -18,11 +19,13 @@ static Configs()
{
Formatting = Formatting.Indented
};
- var ass = typeof(Configs).Assembly;
- var loc = IOPath.GetFullPath(ass.Location);
- var dir = IOPath.GetDirectoryName(loc) ?? string.Empty;
- BoxConfigName = IOPath.Combine(dir, "86Box.json");
- VmxConfigName = IOPath.Combine(dir, "86BoxVMs.json");
+
+ var userConfigDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, Environment.SpecialFolderOption.Create);
+ var appConfigDir = IOPath.Combine(userConfigDir, "86BoxManager");
+ if (!Directory.Exists(appConfigDir)) Directory.CreateDirectory(appConfigDir);
+
+ BoxConfigName = IOPath.Combine(appConfigDir, "86Box.json");
+ VmxConfigName = IOPath.Combine(appConfigDir, "86BoxVMs.json");
}
private static void WriteJson(string fileName, object obj)