2222
2323package processing .app .windows ;
2424
25- import cc .arduino .os .windows .FolderFinderInWindowsEnvVar ;
26- import cc .arduino .os .windows .FolderFinderInWindowsRegistry ;
25+ import cc .arduino .os .windows .Win32KnownFolders ;
2726import processing .app .legacy .PApplet ;
2827import processing .app .legacy .PConstants ;
2928
@@ -50,28 +49,18 @@ public void init() throws Exception {
5049 }
5150
5251 private void recoverSettingsFolderPath () throws Exception {
53- FolderFinderInWindowsRegistry findInUserShellFolders = new FolderFinderInWindowsRegistry (null , "Documents" , "Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ User Shell Folders" , "Local AppData" );
54- FolderFinderInWindowsRegistry findInShellFolders = new FolderFinderInWindowsRegistry (findInUserShellFolders , "Documents" , "Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ Shell Folders" , "Local AppData" );
55-
56- Path path = findInShellFolders .find ();
57- this .settingsFolder = path .resolve ("Arduino15" ).toFile ();
52+ Path path = Win32KnownFolders .getLocalAppDataFolder ().toPath ();
53+ settingsFolder = path .resolve ("Arduino15" ).toFile ();
5854 }
5955
6056 private Path recoverOldSettingsFolderPath () throws Exception {
61- FolderFinderInWindowsRegistry findInUserShellFolders = new FolderFinderInWindowsRegistry (null , "Documents" , "Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ User Shell Folders" , "AppData" );
62- FolderFinderInWindowsRegistry findInShellFolders = new FolderFinderInWindowsRegistry (findInUserShellFolders , "Documents" , "Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ Shell Folders" , "AppData" );
63-
64- Path path = findInShellFolders .find ();
57+ Path path = Win32KnownFolders .getRoamingAppDataFolder ().toPath ();
6558 return path .resolve ("Arduino15" );
6659 }
6760
6861 private void recoverDefaultSketchbookFolder () throws Exception {
69- FolderFinderInWindowsEnvVar findInUserProfile = new FolderFinderInWindowsEnvVar (null , "Documents" , "USERPROFILE" );
70- FolderFinderInWindowsRegistry findInUserShellFolders = new FolderFinderInWindowsRegistry (findInUserProfile , "Documents" , "Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ User Shell Folders" , "Personal" );
71- FolderFinderInWindowsRegistry findInShellFolders = new FolderFinderInWindowsRegistry (findInUserShellFolders , "Documents" , "Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ Shell Folders" , "Personal" );
72-
73- Path path = findInShellFolders .find ();
74- this .defaultSketchbookFolder = path .resolve ("Arduino" ).toFile ();
62+ Path path = Win32KnownFolders .getDocumentsFolder ().toPath ();
63+ defaultSketchbookFolder = path .resolve ("Arduino" ).toFile ();
7564 }
7665
7766 /**
0 commit comments