2

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:

  1. 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.
  2. This app starts as a normal OSX application and is - in fact - a native game launcher.
  3. The launcher loads the game settings and license credentials from ~/Library/Application Support/minecraft/ . This folder gets created if nonexistent.
  4. The user is then prompted to click a green button to start the videogame.
  5. Once the game is started, the launcher executes Java code and loads assets which are also located in folder ~/Library/Application Support/minecraft/.
  6. 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 (or ~/Library/Application Support) folder?

  • stackoverflow.com/questions/14531917/… any help? – Tetsujin Jun 29 '17 at 12:55
  • @Tetsujin Thanks for the link, this command line way to start Minecraft is interesting, though unfortunately it does not solve the issue as I'd "only" like to start the actual .app Application normally, except for changed library directory – Manchineel Jun 29 '17 at 13:07
  • idk minecraft at all - but I do use s similar method for another online 'game' using an Applescript app which fires the required command line switches & launches the app, using shellscript. The app then stays open until the game quits, then quits itself. – Tetsujin Jun 29 '17 at 13:11
  • @Tetsujin apparently Minecraft launcher features a commandline API, but on OSX and Linux it only works with the .jar iteration of the launcher, which requires Java to be installed on the machine and defeats the purpose of this setup. – Manchineel Jun 29 '17 at 13:20
  • Can you create a symbolic link in target machine's home folder? If yes, you can do something like this ln -s "/your_USB_flash/your_minecraft_resources/Library/Application Support/minecraft" "~/Library/Application Support/" – toma Jun 29 '17 at 15:12

You must log in to answer this question.

Browse other questions tagged .