@@ -209,6 +209,20 @@ public Base(String[] args) throws Exception {
209
209
parser .parseArgumentsPhase1 ();
210
210
commandLine = !parser .isGuiMode ();
211
211
212
+ BaseNoGui .checkInstallationFolder ();
213
+
214
+ // If no path is set, get the default sketchbook folder for this platform
215
+ if (BaseNoGui .getSketchbookPath () == null ) {
216
+ File defaultFolder = getDefaultSketchbookFolderOrPromptForIt ();
217
+ if (BaseNoGui .getPortableFolder () != null )
218
+ PreferencesData .set ("sketchbook.path" , BaseNoGui .getPortableSketchbookFolder ());
219
+ else
220
+ PreferencesData .set ("sketchbook.path" , defaultFolder .getAbsolutePath ());
221
+ if (!defaultFolder .exists ()) {
222
+ defaultFolder .mkdirs ();
223
+ }
224
+ }
225
+
212
226
SplashScreenHelper splash ;
213
227
if (parser .isGuiMode ()) {
214
228
// Setup all notification widgets
@@ -243,20 +257,6 @@ public Base(String[] args) throws Exception {
243
257
untitledFolder = FileUtils .createTempFolder ("untitled" + new Random ().nextInt (Integer .MAX_VALUE ), ".tmp" );
244
258
DeleteFilesOnShutdown .add (untitledFolder );
245
259
246
- BaseNoGui .checkInstallationFolder ();
247
-
248
- // If no path is set, get the default sketchbook folder for this platform
249
- if (BaseNoGui .getSketchbookPath () == null ) {
250
- File defaultFolder = getDefaultSketchbookFolderOrPromptForIt ();
251
- if (BaseNoGui .getPortableFolder () != null )
252
- PreferencesData .set ("sketchbook.path" , BaseNoGui .getPortableSketchbookFolder ());
253
- else
254
- PreferencesData .set ("sketchbook.path" , defaultFolder .getAbsolutePath ());
255
- if (!defaultFolder .exists ()) {
256
- defaultFolder .mkdirs ();
257
- }
258
- }
259
-
260
260
splash .splashText (tr ("Initializing packages..." ));
261
261
BaseNoGui .initPackages ();
262
262
0 commit comments