mirror of
https://github.com/processing/processing4.git
synced 2026-06-08 16:40:46 +02:00
Merge pull request #1022 from Stefterv/store-installs
Store where Processing is installed
This commit is contained in:
@@ -166,6 +166,20 @@ public class Base {
|
||||
static private void createAndShowGUI(String[] args) {
|
||||
// these times are fairly negligible relative to Base.<init>
|
||||
// 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()) {
|
||||
|
||||
Reference in New Issue
Block a user