Omnishell/ConfigFile.cs
using System;
using System.IO; using System.Reflection; namespace Module { internal static class ConfigFile { public static void SetupConfigFile() { Assembly assembly = Assembly.GetExecutingAssembly(); DirectoryInfo pi = Directory.GetParent(assembly.Location); string srcConfig = Path.Combine(pi.FullName, "config.json"); string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string omnishellAppData = Path.Combine(appData, "Omnishell"); string omnishellConfig = Path.Combine(omnishellAppData, "config.json"); if (!Path.Exists(omnishellConfig)) { Directory.CreateDirectory(omnishellAppData); File.Copy(srcConfig, omnishellConfig); } } } } |