match new behaviour in bitcoin core 28 for default windows data dir

This commit is contained in:
Craig Raw 2025-01-22 09:49:50 +02:00
parent 7a5f4ff294
commit d7511c62bf

View file

@ -914,7 +914,8 @@ public class ServerPreferencesController extends PreferencesDetailController {
if(osType == OsType.MACOS) {
return new File(System.getProperty("user.home") + "/Library/Application Support/Bitcoin");
} else if(osType == OsType.WINDOWS) {
return new File(System.getenv("APPDATA") + "/Bitcoin");
File oldDir = new File(System.getenv("APPDATA") + "/Bitcoin");
return oldDir.exists() ? oldDir : new File(System.getenv("LOCALAPPDATA") + "/Bitcoin");
} else {
return new File(System.getProperty("user.home") + "/.bitcoin");
}