I'm trying to set up the Minecraft game so that I can launch it from and run it onto a USB flash drive (portable game and savefiles without additional config to play on each Mac). This is normal behaviour of game startup:
- An Application (.app) is launched. This app is a custom Java wrapper, the game internally uses Java, though not the system-wide installed copy. Instead, it uses a dedicated and customised copy of JRE which - AFAIK - is located in the .app file/folder.
- This app starts as a normal OSX application and is - in fact - a native game launcher.
- The launcher loads the game settings and license credentials from
~/Library/Application Support/minecraft/. This folder gets created if nonexistent.
- The user is then prompted to click a green button to start the videogame.
- Once the game is started, the launcher executes Java code and loads assets which are also located in folder
- Once this has been done, the launcher app passes the game folder location used to load the game to the actual game, which is a Java app.
The game's setup is pretty unusual, so a launcher is mandatory, but it seems that the game respects whatever folder was defined by the launcher. The windows version of this game (which has same launcher and same Java binaries, only compiled for another platform) runs from
%AppData%/.minecraft and if you start the game EXE with a Batch script and you define a custom AppData folder, the game adapts accordingly.
In the past, when this game used to rely on the locally installed Java, I remember I could edit the app's .plist file in Xcode or TextEdit to define a custom Library folder on OSX, and it ran perfectly. So, using either a .app modification, a Bash script or an AppleScript, without making a Symlink and without requiring Sudo password of a machine, nor having to configure this for every Mac I will use this app onto, how do I start an Application with a different
~/Library/Application Support) folder?