leave roaming appdir installs that already exist alone

This commit is contained in:
hankhill19580
2019-11-09 01:36:53 +00:00
parent ff293d50a9
commit 7b53b0d3ad
4 changed files with 17 additions and 8 deletions

View File

@ -83,6 +83,15 @@ public class WorkingDir {
String appdata = System.getenv("LOCALAPPDATA");
if (appdata != null)
home = appdata;
// Don't mess with existing Roaming Application Data installs,
// in case somebody is using roaming appdata for a reason
// already. In new installs, use local appdata by default. -idk
String oldappdata = System.getenv("APPDATA");
if (oldappdata != null) {
File checkOld = new File(oldappdata, WORKING_DIR_DEFAULT_WINDOWS);
if (checkOld.exists() && checkOld.isDirectory())
home = appdata;
}
dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_WINDOWS);
} else if (SystemVersion.isMac()) {
String appdata = "/Library/Application Support/";