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

Revisit LibraryManager folder structure for app data #636

Open
ariellourenco opened this issue Jul 20, 2021 · 2 comments
Open

Revisit LibraryManager folder structure for app data #636

ariellourenco opened this issue Jul 20, 2021 · 2 comments

Comments

@ariellourenco
Copy link

On Windows, applications should not be creating folders/files directly in %USERPROFILE%. The proper location for configuration files is %APPDATA%<vendor><product> and the proper location for cache files is %LOCALAPPDATA%\<vendor>\<product>. Things should only be added to %USERPROFILE% if the user explicitly requests it via a save dialog box.

Please move %USERPROFILE%\.librarymanager to %APPDATA%\librarymanager as the default location. The fact that configuration files should go in %APPDATA% is well documented in Microsoft's OS documentation in a number of places as well as MSDN. Also, in Windows folders should not be named with a . prefix as Windows explorer doesn't allow creation of folders with that name which leads to problems.

related to: microsoft/vscode#3884

@diogocp
Copy link

diogocp commented Sep 2, 2021

public string UserDataRoot
{
get
{
string envVar = "%HOME%";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
envVar = "%USERPROFILE%";
}
return Path.Combine(Environment.ExpandEnvironmentVariables(envVar), ".librarymanager");
}
}

@jcotton42
Copy link

Should note that the current placement isn't valid on macOS or Linux either. On macOS it should be somewhere under ~/Library, and on Linux it should be in the appropriate XDG directory https://wiki.archlinux.org/title/XDG_Base_Directory

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

No branches or pull requests

3 participants