Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new configuration directory #8

Closed
ihaveamac opened this issue May 2, 2018 · 9 comments
Closed

Add new configuration directory #8

ihaveamac opened this issue May 2, 2018 · 9 comments

Comments

@ihaveamac
Copy link
Owner

Maybe I should add a specific one? Some config files could go here. Don't know exactly what though.

  • Windows: %APPDATA%\fuse3ds
  • macOS: ~/Library/Application Support/fuse3ds (or maybe use the one below too)
  • Linux: ~/.config/fuse3ds
@CuriousTommy
Copy link
Contributor

For Linux, does this application support the XDG Base Directory Standard? That would be nice to have.

Also for MacOS, you should support both, have it look at the Application Support first if the files are there, then check in the .config folder.

@ihaveamac
Copy link
Owner Author

It doesn't use a standard like that right now, since it has no configuration directory specific to this application. The only paths it checks right now for boot9/seeddb are current dir, ~/.3ds, and ~/3ds. The first one is taken from some of yellows8's projects and shared with another one of mine, the second is easier for Windows users to create, because Windows/File Explorer doesn't easily allow creating directories starting with a period.

This new one would be specific to fuse-3ds and would store more than just boot9/seeddb (if the user wants to put them here). I would need to read more about the standard but it seems XDG_CONFIG_HOME generally points to $HOME/.config.

@ihaveamac
Copy link
Owner Author

ihaveamac commented Oct 11, 2018

URL is now https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html (first one did not load for me anymore)

For fuse-3ds specific configuration (e.g. update check/notify settings), I'm thinking of going with only one fixed path per OS: %APPDATA%\fuse-3ds, ~/Library/Application Support/fuse-3ds, and $XDG_CONFIG_HOME/fuse-3ds. Unlike the one that store boot9/seeddb/etc, which can be different paths, since some other programs may now support them (e.g. ctrcdnfetch uses these paths to read certificates).

@ihaveamac
Copy link
Owner Author

03d1931 new config_dir variable that contains these paths, but is currently unused.

For Linux, it uses $XDG_CONFIG_HOME/fuse-3ds if it's set, checks paths of $XDG_CONFIG_DIRS (defaults to /etc/xdg if not set) to see if fuse-3ds already exists in one of them, then falls back to ~/.config/fuse-3ds. I think this is how the standard works.

@CuriousTommy
Copy link
Contributor

The only concern I have with using XDG_CONFIG_DIRS is that the user may be required to use root to store files in there (especially if the default location is fuse-3ds), otherwise everything is fine (if you intend to keep it in a config directory).

Thanks again for using the XDG standard!

@ihaveamac
Copy link
Owner Author

ihaveamac commented Oct 11, 2018

According to https://wiki.archlinux.org/index.php/XDG_Base_Directory XDG_CONFIG_DIRS is for system directories, and defaults to /etc/xdg. Though the standard also says that XDG_CONFIG_DIRS has a list of extra directories to search in addition to XDG_CONFIG_HOME (if it's not set), so I decided to check it just in case. fuse-3ds would never automatically create a config in any XDG_CONFIG_DIRS directories, only used if the user explicitly sets it up, knowing that it may require elevated privileges.

@ihaveamac
Copy link
Owner Author

Commits 3dfc024 8c82ce6 aa75770 58b4529 add support for using update.cfg in this new configuration directory. Only tested on Mac so far.

@ihaveamac
Copy link
Owner Author

Tested on Windows & Linux now (including XDG_CONFIG_HOME).

@CuriousTommy
Copy link
Contributor

fuse-3ds would never automatically create a config in any XDG_CONFIG_DIRS directories, only used if the user explicitly sets it up, knowing that it may require elevated privileges.

Makes sense. I was thinking why you need to use XDG_CONFIG_DIRS, but I can see why you want to have support for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants