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

Simplify config file/folder locations #352

Closed
sa666666 opened this issue Aug 17, 2018 · 25 comments
Closed

Simplify config file/folder locations #352

sa666666 opened this issue Aug 17, 2018 · 25 comments
Assignees
Labels
Milestone

Comments

@sa666666
Copy link
Member

sa666666 commented Aug 17, 2018

The current system has become extremely unwieldy, with way too much configuration being possible. To make it easier on the end-user, I propose that there be a minimum of user-definable locations (changeable within the UI or on the commandline):

  • the ROM directory: currently set when the app runs for the first time and selects a ROM
  • the 'base' directory: the location where all configuration files/folders that aren't typically editable by the end-user are placed (currently, ~/.config/stella for Linux, %APPDATA%\stella for Windows, etc),
  • snapshot load/save directories

Furthermore, there should be a 'HOME' directory where stuff can be stored that we expect the user to be able to easily access/modify. For Linux, this is basically $HOME, for Windows it's 'My Documents\Stella', etc. This location should not be modifiable, else we get back to the same over-configurability issue as before.

Some of this can be completed for 6.0, and the rest may have to be pushed to 6.1

@sa666666 sa666666 added enhancement target 6.0 Christmas 2018 Release target 6.1 2020-03 Release labels Aug 17, 2018
@sa666666 sa666666 added this to the Prio 2 milestone Aug 17, 2018
@thrust26
Copy link
Member

thrust26 commented Aug 17, 2018

'My Documents/Stella' has made problems in Windows already. I suppose Microsoft will restrict this even more in the future.
http://atariage.com/forums/topic/280235-stella-creating-folder-in-my-documents/

@sa666666
Copy link
Member Author

sa666666 commented Aug 17, 2018

TBH, I don't know how to solve this. We are using the directory that MS has specifically provided for this scenario, and now they are disallowing it.

Also (rant mode on), doesn't it seem like this issue never goes away? It seems we can never properly deal with file save/load locations to everyone's satisfaction. I never thought this issue would persist longer than getting a new TIA core in Stella 😠

@thrust26
Copy link
Member

I have to read the details, maybe we can get away with a hint in the documentation.

@sa666666
Copy link
Member Author

This is really only a symptom of a larger problem. After all these years, we still haven't properly dealt with file locations. For example, where to save ASM files, read from .lst files, etc. And when loading, do we load from the same location as they were saved? And what about when the app is stored in read-only location (as it should be), and the user also wants to store the files with the app (like Windows does, but REALLY, REALLY shouldn't do??

Adding all this configurability over the years is just a bandaid around the fact that we still haven't nailed down how to load/save config files adequately.

@thrust26
Copy link
Member

thrust26 commented Aug 17, 2018

How does Linux handle this? Can we learn from it without harm for Windows users?

Maybe we should make a complete list of all files Stella handles and then decide what to do with them. For all supported OS and from player and developer perspective.

@sa666666
Copy link
Member Author

How does Linux handle this: the correct way 😈. In Linux, there is a clear separation between user and system files. And for the user, there is even a clear location where config files are placed. Same as OSX (which is based on Unix, which is similar to Linux). Windows is very haphazard in this area, and frequently changes its mind between different releases (as we're now seeing with 'My Documents').

I agree that we should list all the files and folders that Stella will possibly use, and go from there. I will try to get to this later this evening.

@sa666666
Copy link
Member Author

OK, so there is a base directory (what you call 'root', I will call it 'bd' from this point on, to reduce typing):

  • Windows: bd -> %APPDATA%\Stella
  • Linux: bd -> $HOME/.config/stella
  • OSX: $HOME/Library/Application Support/Stella

Under 'bd' we will have the following (non-configurable):

  • stella.cht (cheats)
  • stella.pal (external palette)
  • stella.pro (ROM properties)
  • stellarc (main settings file); note that this is called 'stella.ini' in Windows, and for OSX the settings are stored elsewhere.
  • cfg (dir to store Distella config files); note that we should discuss this in the future, I may remove that functionality entirely if we find that it's not being used)
  • nvram (dir for non-volatile files); currently EEPROM files generated by SaveKey/AVox ROMs
  • snapshots (dir, self-explanatory)
  • state (dir, self-explanatory)

I propose to eliminate being able to change the following (ie, user has no choice on name/location):

  • stella.cht
  • stella.pal
  • stella.pro
  • stellarc
  • cfg dir
  • nvram dir
  • state dir

Snapshots are something that the end user needs access to, so they can't be in a hidden directory (or more to the point, it must be possible to have them elsewhere).

The 'bd' should should be changeable, but it can't be stored in the config file itself, for obvious reasons. This means that one can only change it from the commandline, Windows icon, etc.

We need a common dir that is not hidden, is user-accessible and easy to find, and can store various files that don't really belong anywhere else. Currently that means the following:

  • Windows: My Documents\Stella
  • Linux: $HOME
  • OSX: $HOME

So, that leaves the various other files that Stella can generate/use:

  • .script files: per-ROM (named by ROM), and global (named 'autoexec.script)
  • .cfg files for Distella; currently stored in both ROM path and cfg dir
  • .lst and .sym files; currently stored in ROM path
  • .asm files

Also, some of the above have two or even three possible locations!!

Arrgh 😖

@thrust26
Copy link
Member

Maybe a path named "Develop", "Debug"... below My Documents\Stella for the created, related files? .lst and .sym should always come from ROM path (incl. cfg).

That or everything goes into ROM path.

BTW: shouldn't it be $HOME/Stella for Linux/OSX?

@sa666666
Copy link
Member Author

I figured some should go with the ROM, so that means we can get rid of the 'cfg' directory entirely, and store cfg files there too.

The reason that Linux/OSX don't use $HOME/Stella is that it's considered 'rude' to create visible directories in $HOME unless absolutely necessary on those systems. You can create hidden directories, but then we're back to the same problem.

@sa666666
Copy link
Member Author

TBH, I'm leaning to putting any file that's related to a specific ROM in the ROM directory directly, and just be done with it.

@thrust26
Copy link
Member

Ok, for files Stella creates.

Regarding $HOME: Isn't that causing a huge mess in that directory?

@sa666666
Copy link
Member Author

Well, I think the functionality is used so rarely that it doesn't matter. Which is another reason for getting rid of the idea entirely. If we place all ROM-specific stuff with the ROMs, and allow snapshot and basedir to be configurable, I guess there's nothing left for the other folder. Besides, these are just the defaults; the user can change it if they like. So it's more about creating useful defaults. Those users that don't use Stella very rigorously won't care, and those that do will have enough experience to pick a better default :)

@sa666666
Copy link
Member Author

Off to work on the house again ...

@thrust26
Copy link
Member

Maybe sleep one night before you continue in anger. 😉

@sa666666 sa666666 removed the target 6.0 Christmas 2018 Release label Dec 26, 2018
@sa666666 sa666666 modified the milestones: Prio 2, Prio 1 Feb 16, 2019
sa666666 referenced this issue Feb 16, 2019
- only 'romdir' is configurable; the rest are now always under the 'basedir'
- next step is to allow 'basedir' to be configurable, and optionally use the APP dir
- ConfigPathDialog dialog is now almost empty (only contains romdir), so perhaps this can move elsewhere
@thrust26
Copy link
Member

Maybe you should implement the APP dir option only for the Windows version. 😄

@sa666666
Copy link
Member Author

Yes, that's actually the plan. There's no way to reliably do this in Linux/macOS, but there is in Windows. So for now at least, that's the only version that will get it.

@thrust26
Copy link
Member

@sa666666 Is this done?

@sa666666
Copy link
Member Author

Testing still required, so leave open for now. Also, I need to add just a little more to it. But it's perhaps 98% done.

@thrust26
Copy link
Member

There are quite a lot of references to now gone path configurations in the doc. I better leave cleaning that up to you.

@sa666666
Copy link
Member Author

Yes, that's part of the 2% I need to finish.

@sa666666
Copy link
Member Author

Finishing up documentation on this, done in the last few commits. I think we're almost ready to close this one (and hopefully never have to revisit it again).

@nitro322
Copy link

nitro322 commented Jan 11, 2020

Hello. Looks like a lot of consideration has been given config file structure, so I hope I'm not stirring anything up here, but is it possible to specify config file from the CLI? Ie., something like:

stella -conf ~/my/alternate/stellarc

If not, would it be possible to add it?

The standardization under ~/.config/stella makes perfect sense, but I'm setting up Stella for use on multiple machines and want to share the configuration and resources on a NAS. I could get by with a bunch of symlinks and whatnot, but it'd be easier if I could specify a shared stellarc file from the CLI. I can configure all other paths within stellarc, just need a way to tell Stella where to find the appropriate config file.

Would be helpful, but clearly not critical. Thanks for the consideration.

@sa666666
Copy link
Member Author

The code already added will address this. I just tested, and if you type stella -basedir CONF, it will create a 'CONF' directory, and place stellarc and everything else under it.

So the functionality you want is already there (albeit called 'basedir' instead); we just need to actually release 6.1 so people can use it 😈

@nitro322
Copy link

Ahh, good deal. I'm still using 6.0.2 and didn't see that option. I just built from trunk and confirmed -basedir works great. Thanks a bunch! Looking forward to the next release. :-)

@sa666666
Copy link
Member Author

I've tested this on several systems, and it seems to be working fine. Closing for now, pending results from beta testing; will re-open if necessary.

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

No branches or pull requests

3 participants