From 025445fc65e68b4766808e8b1ca70852a4ae3838 Mon Sep 17 00:00:00 2001
From: idk <hankhill19580@gmail.com>
Date: Thu, 22 Apr 2021 23:27:31 -0400
Subject: [PATCH] When checking whether to use Roaming appdata(like on older
 installs or on installs where people deliberately use Roaming appdata) also
 check whether clients.config exists and if it does, set home to Roaming
 appdata since people may be updating from routers before the migration to
 clients.config.d directories. This should fix #16

---
 router/java/src/net/i2p/router/startup/WorkingDir.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/router/java/src/net/i2p/router/startup/WorkingDir.java b/router/java/src/net/i2p/router/startup/WorkingDir.java
index f893a68723..bd8c2cfbc1 100644
--- a/router/java/src/net/i2p/router/startup/WorkingDir.java
+++ b/router/java/src/net/i2p/router/startup/WorkingDir.java
@@ -101,6 +101,9 @@ public class WorkingDir {
                         File clientAppsConfig = new File(checkOld.getAbsolutePath(), "clients.config.d");
                         if (routerConfig.exists() && clientAppsConfig.exists() && clientAppsConfig.isDirectory())
                             home = appdata;
+                        clientAppsConfig = new File(checkOld.getAbsolutePath(), "clients.config");
+                        if (routerConfig.exists() && clientAppsConfig.exists())
+                            home = appdata;
                     }
                 }
                 dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_WINDOWS);
-- 
GitLab