Phrynohyas / eve-o-preview

An EVE client window switcher tool created to aid playing with multiple clients in CCP game EVE Online
https://forums.eveonline.com/t/eve-o-preview/4202
MIT License
293 stars 108 forks source link

[Bug] Configuration file location #171

Closed wvdvegt closed 3 years ago

wvdvegt commented 3 years ago

Hi

Adding

        private readonly static string ConfigurationFileName = Path.Combine(Environment.GetFolderPath(
  Environment.SpecialFolder.ApplicationData), "EVE-O Preview", "EVE-O Preview.json");

in ConfigurationStorage.cs and changing GetConfigFileName() to

        private string GetConfigFileName()
        {
            string filename = string.IsNullOrEmpty(this._appConfig.ConfigFileName) ? ConfigurationStorage.ConfigurationFileName : this._appConfig.ConfigFileName;

            if (!Directory.Exists(Path.GetDirectoryName(filename)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(filename));
            }

            return filename;
        }

makes sure that the config file is created where it should, under %appdata% instead of alongside the executable (which prevent putting it where it should, somewhere under c:\program files.

Phrynohyas commented 3 years ago

Some people have hard times finding config file and crash log(s) even when they are located next to the .exe file. Also this change would break x-copy deployment and backwards compatibility.