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

Portable settings #360

Closed
wants to merge 2 commits into from
Closed

Conversation

Eskaan
Copy link

@Eskaan Eskaan commented Jan 21, 2022

The Feature

Added a "settingsPath.txt" file inside of the App itself that, when a path is put in, uses the given path to redirect the settings from the usual %AppData%/Processing folder to the given folder.

What it does

It modifies the getSettingsFolder method in Base that provides the folder so that it first checks (and creates) the settingsPath file in the app folder. If this file then contains a line, it will try using this String as the setting folder (relative paths possible). If the file is empty or doesn't exist, it will use the default directory for the settings.

Why do I want that feature?

processing/processing4#357
I need this feature in the program because my Teacher wants to use it in our school and I don't want to manually search and install every library I want. I will also create a pr for a hopefully portable version of the app by moving the settings into the app or (more likely) creating a file inside of the app containing the path to the settings file (needed because %AppData% resets every time rebooting a school PC). Please tell me if you have a solution in mind so I can build it to your wishes.

Sidenotes

  • I know you don't want too much code in the Base class (you mentioned it somewhere) but I see this as the best solution.
  • If you take the windows and linux versions of the app and edit each app's setting paths it gets fully portable across systems :D

Draft

  • Will follow up whit GUI implementation soon. Under the sketch location or at the bottom?
  • Maybe a parser for the relative paths to make them less confusing:
    /home/apps/Processing.app/../../foo/bar/ -> /home/foo/bar/
  • Check if relative path validation works on windows. If not.. Well a few if statements will do.
  • Generally test feature on Windows since I am on a Mac.

@benfry
Copy link
Owner

benfry commented Jan 22, 2022

Adding this back for 4.0 beta 4… Not unlike the approach here, you'll just need to make a settings.txt file inside lib, and include settings.path=/an/absolute/path/for/settings to make it work.

(The commit isn't pushed here yet because I'm breaking some other things at the moment and don't want to break the repo.)

@benfry benfry closed this in 1a49263 Jan 22, 2022
@benfry
Copy link
Owner

benfry commented Jan 22, 2022

Those changes are now committed; if you run into problems, file an issue and I can look into it. I haven't had time to test it yet.

@github-actions
Copy link

This pull request has been automatically locked. Pull requests that have been closed are automatically locked 30 days after the last comment.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants