Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support environment variables for the instance hooks #1238

Open
ellet0 opened this issue Jun 24, 2024 · 0 comments
Open

Support environment variables for the instance hooks #1238

ellet0 opened this issue Jun 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ellet0
Copy link

ellet0 commented Jun 24, 2024

Is your suggested enhancement related to a problem? Please describe.

It's not directly related to a specific issue or bug, yet it makes it hard to share instances as we have to hardcode things like instance directory path or the Java binary executable path.

See MultiMC Custom Commands for details.

Describe the solution you'd like

The simplest solution is to simply replace the supported variables like $INST_MC_DIR with something like C:\Users\%USERPROFILE%\AppData\Roaming\com.modrinth.theseus\profiles\Test1on Windows for example, the instance directory path is already available in the current code, we just have to replace it or pass it to for example, allow using it in the commands to run a JAR file that exists in the instance directory.

I suggest to support the following for compatibility:

  1. $INST_NAME: The name of the instance
  2. $INST_ID: The name of the instance's root directory
  3. $INST_DIR: The absolute path to the instance directory
  4. $INST_MC_DIR: Alias for $INST_DIR
  5. $INST_JAVA: The absolute path to the java executable used for launch
  6. $INST_JAVA_ARGS: The JVM parameters used for launch

As they are widely supported in launchers like MultiMC, Prism Launcher, and even other launchers that are not based on MultiMC.

Describe alternatives you've considered

For now, we will have to hardcode the full path to the Java installed on the launcher and the instance path, making it hard to share with other users.

Additional context

Examples of launchers that support this feature:

image
image
image

Related issues:

@ellet0 ellet0 added the enhancement New feature or request label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant