Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.<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()) {
Expand Down
Loading