Skip to content

Store where Processing is installed #1022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
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