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 109 forks source link

Move config file to writeble location #137

Closed wvdvegt closed 5 years ago

wvdvegt commented 5 years ago

In order to correct behavior that is for long flagged as not done anymore (writing in the applications directory (preventing it to be installed in for example program files), I replaced the ConfigurationFileName in ConfigurationStorage by:

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

and GetConfigFileName() in ConfigurationStorage by:

        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;
        }

This change moves the default EVE-O Preview.json config file to '%appdata%\EVE-O Preview\EVE-O Preview.json".

Sakata-MC commented 5 years ago

Please make this an option, though. I run this as a portable app in its own happy little folder. Also.... %appdata% isn't as easily accessible to most users, and is annoying to others.

wvdvegt commented 5 years ago

Hi

Have to agree, with the previous poster, and having a command-line option to specify a configuration would make it even more versatile.

When having multiple users sharing configuration the location should be changed to:

Environment.SpecialFolder.CommonApplicationData

Phrynohyas commented 5 years ago

Way too much hustle to solve a problem that doesn't actually exist