File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,20 @@ static public void main(final String[] args) {
166
166
static private void createAndShowGUI (String [] args ) {
167
167
// these times are fairly negligible relative to Base.<init>
168
168
// long t1 = System.currentTimeMillis();
169
+ var preferences = java .util .prefs .Preferences .userRoot ().node ("org/processing/app" );
170
+ var installLocations = new ArrayList <>(List .of (preferences .get ("installLocations" , "" ).split ("," )));
171
+ var installLocation = System .getProperty ("user.dir" ) + "^" + Base .getVersionName ();
172
+
173
+ // Check if the installLocation is already in the list
174
+ if (!installLocations .contains (installLocation )) {
175
+ // Add the installLocation to the list
176
+ installLocations .add (installLocation );
177
+
178
+ // Save the updated list back to preferences
179
+ preferences .put ("installLocations" , String .join ("," , installLocations ));
180
+ }
181
+ // TODO: Cleanup old locations if no longer installed
182
+ // TODO: Cleanup old locations if current version is installed in the same location
169
183
170
184
File versionFile = Platform .getContentFile ("lib/version.txt" );
171
185
if (versionFile != null && versionFile .exists ()) {
You can’t perform that action at this time.
0 commit comments