Using custom `main(String[] args)` breaks file reading functions in Windows (e.g. `loadShader()`, `loadImage()`)

Just to make sure if the sketchPath is still recognized in recent Processing versions when we run the exported sketch using a customized main(), I’ve coded this simple test sketch below: :crazy_face:

/**
 * PApplet.main() (v1.0)
 * GoToLoop (2018/Aug/12)
 *
 * Discourse.Processing.org/t/
 * using-custom-main-string-args-breaks-file-reading-functions-
 * in-windows-e-g-loadshader-loadimage/2572/10
 */

public static void main(final String[] args) {
  final String sketch = Thread.currentThread().getStackTrace()[1].getClassName();
  main(sketch, args);
}

@Override public void settings() {
  size(800, 60);
  noLoop();

  println(sketchPath());
  printArray(args);
}

@Override public void draw() {
  clear();
  text(sketchPath(), 20, 20);
  if (args != null)  text(join(args, " : "), 20, 40);
}

BtW, I’m using most recent 64-bit PDE v3.4 on Win 8.1 to export the sketch above. :computer:

I went to the exported’s subfolder “application.windows64/” and double-clicked the “.exe” file there. :open_file_folder:

And the sketchPath shown there matches the full path where I’m running it! :ok_hand:

I can even open a command prompt and run the “.exe” passing typed args to it, and they’re also displayed! :star_struck: