mindstorm38 / portablemc

A fast, reliable and cross-platform command-line Minecraft launcher and API for developers. Including fast and easy installation of common mod loaders such as Fabric, Forge, NeoForge and Quilt.
https://pypi.org/project/portablemc/
GNU General Public License v3.0
372 stars 20 forks source link

Suggestion: Move PortableMC files from work-dir to main-dir #234

Open RuiNtD opened 5 days ago

RuiNtD commented 5 days ago

In PortableMC's current state, it's hard to use it for multiple "instances", since every instance (every distinct --work-dir) has its own portablemc_auth.json, requiring the user to login to each instance. It would be nice if PortableMC put its own files (including portablemc_version_manifest.json) into main-dir, next to assets and libraries, which would be consistent with every other Minecraft launcher.

mindstorm38 commented 3 days ago

Thanks for the suggestion! This improvement will be definitely included in the next major version, which is the rewrite in Rust (see #196). The portablemc_version_manifest.json file will be removed definitely and replaced by a file cache in standard OS-specific user local cache directory, for the authentication database, it's not yet implemented in the rewrite, but we'll support an argument to specify the location of the database. By default, it will still be located in the work dir by default I think, because my idea is that the main directory should possibly be read-only to users (allowing shared main directory). But at the same time it's right, and I've been thinking about this for some time, that it can also be very practical to also share a common database to all users, I'm very interested in your opinion about that!

RuiNtD commented 3 days ago

In my mind the main dir is meant for anything launcher related and the work dir should be strictly for the game itself. Minecraft Launcher, as well as every other launcher, make this distinction and put the auth files in a consistent location, along with assets and libraries. It might make sense with the rewrite to tweak these argument names. work-dir could probably be mc-dir and main-dir could probably stay as-is.

mindstorm38 commented 3 days ago

I like this opinion, and the mc-dir arg is a great idea I never thought about, I'll consider implementing this! I'll also consider adding an argument for changing the database location manually if needed, and by the way there will be support for specifying these via env variables!