diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 07e23d36b..ec51da59d 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -166,6 +166,20 @@ static public void main(final String[] args) { static private void createAndShowGUI(String[] args) { // these times are fairly negligible relative to Base. // long t1 = System.currentTimeMillis(); + var preferences = java.util.prefs.Preferences.userRoot().node("org/processing/app"); + var installLocations = new ArrayList<>(List.of(preferences.get("installLocations", "").split(","))); + var installLocation = System.getProperty("user.dir") + "^" + Base.getVersionName(); + + // Check if the installLocation is already in the list + if (!installLocations.contains(installLocation)) { + // Add the installLocation to the list + installLocations.add(installLocation); + + // Save the updated list back to preferences + preferences.put("installLocations", String.join(",", installLocations)); + } + // TODO: Cleanup old locations if no longer installed + // TODO: Cleanup old locations if current version is installed in the same location File versionFile = Platform.getContentFile("lib/version.txt"); if (versionFile != null && versionFile.exists()) {