Skip to content

Correct path to preferences file for Windows #6061

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

Closed

Conversation

terrillmoore
Copy link

The path to preferences.txt was incorrect for Windows. I did not update the HISTORY for this change, as this is just correcting a typo.

The path as given is right for Windows 7 and later; I think it is right for Vista, wrong for XP, but do not have systems for testing.

The path to `preferences.txt` was incorrect for Windows. I did not update the HISTORY for this change, as this is just correcting a typo. 

The path as given is right for Windows 7 and later; I think it is right for Vista, wrong for XP, but do not have systems for testing.
@mastrolinux mastrolinux added the in progress Work on this item is in progress label Mar 11, 2017
@per1234
Copy link
Collaborator

per1234 commented Mar 12, 2017

The macOS/Mac OS X path should also be documented. I believe it's /Users/{username}/Library/Arduino15/preferences.txt

@terrillmoore
Copy link
Author

I don't have a Mac for testing. Perhaps issues should be filed for:

  1. Changing / to \\ for Windows systems, where appropriate,
  2. Fix the Windows path for the sketchbook: My Documents/Arduino doesn't exist as such on Windows 10, and (as @PaulStoffregen pointed out on Fix path to preferences.txt on Windows #6060) the right syntax on Win10 would be something like %USERPROFILE%\Documents\Arduino. I'm not sure what it would be on XP (where My Documents still exists).
  3. Also as @PaulStoffregen pointed out, consider using %LocalAppData%\Arduino15\preferences.txt
  4. Changing Mac OS X to macOS (for consistency)
  5. Fixing the macOS path description(s).

For 1 & 2, My feeling is that anyone using Arduino from the command line on Windows is very likely to be using git bash, or the like, not cmd.exe; so they're going to be more interested in a ~-based specification. But perhaps we need to document cmd.exe and assume that people doing advanced things can figure it out. (Now that there's Ubuntu-on-Windows, bash could be git bash, could be Ubuntu bash, or could be cygwin bash.)

@per1234
Copy link
Collaborator

per1234 commented Mar 12, 2017

I don't have a Mac for testing

I don't have a Mac either, I found that information on the forum so I wouldn't feel comfortable submitting a PR for the change without verification.

  1. Fix the Windows path for the sketchbook

It seems most simple to just remove any specific sketchbook path descriptions for all OSs from the documentation and instead refer people to sketchbook.path in preferences.txt (which is already documented) or File > Preferences > Sketchbook location (which is not currently in the documentation).

My feeling is that anyone using Arduino from the command line on Windows is very likely to be using git bash

I don't think that's a safe assumption. CLI will frequently not actually be used directly from the command line but instead from batch files, shortcuts, or other applications.

@facchinm facchinm added the Component: Documentation Related to Arduino's documentation content label Mar 13, 2017
@@ -212,7 +212,9 @@ EXIT STATUS

FILES
-----
*~/.arduino15/preferences.txt*::

*~/AppData/Local/Arduino15/preferences.txt* (Windows)::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the correct path in windows is %APPDATA%/Local/Arduino15/preferences.txt, any other way to express it is not compliant (although it's used by git shell or cygwin or similar)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also %LOCALAPPDATA%/Arduino15/preferences.txt

*~/.arduino15/preferences.txt*::

*~/AppData/Local/Arduino15/preferences.txt* (Windows)::
*~/.arduino15/preferences.txt* (Mac OS X and Linux)::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On osx the path is $HOME/Library/Arduino15/preferences.txt, just checked. The Linux one is ok but I'd replace ~ with $HOME

@facchinm facchinm added this to the Release 1.8.3 milestone Mar 20, 2017
@cmaglie cmaglie closed this in 5426412 May 29, 2017
@cmaglie cmaglie removed the in progress Work on this item is in progress label May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants