From ceac1032c17b496748654c06a56b1f09325136bb Mon Sep 17 00:00:00 2001 From: Slackow <32826498+Slackow@users.noreply.github.com> Date: Sun, 26 Apr 2026 02:00:16 -0400 Subject: [PATCH 1/4] feat: Implement launcher supplementary environmental variables, and env var substitution in hooks --- .../ui/instance_settings/HooksSettings.vue | 2 +- .../ui/settings/DefaultInstanceSettings.vue | 5 + .../app-frontend/src/locales/en-US/index.json | 2 +- packages/app-lib/src/api/profile/mod.rs | 123 +++++++++---- packages/app-lib/src/launcher/hooks.rs | 165 ++++++++++++++++++ packages/app-lib/src/launcher/mod.rs | 58 +++++- packages/app-lib/src/state/process.rs | 5 +- 7 files changed, 322 insertions(+), 38 deletions(-) create mode 100644 packages/app-lib/src/launcher/hooks.rs diff --git a/apps/app-frontend/src/components/ui/instance_settings/HooksSettings.vue b/apps/app-frontend/src/components/ui/instance_settings/HooksSettings.vue index 51305aa539..3bf59cd06b 100644 --- a/apps/app-frontend/src/components/ui/instance_settings/HooksSettings.vue +++ b/apps/app-frontend/src/components/ui/instance_settings/HooksSettings.vue @@ -54,7 +54,7 @@ const messages = defineMessages({ hooksDescription: { id: 'instance.settings.tabs.hooks.description', defaultMessage: - 'Hooks allow advanced users to run certain system commands before and after launching the game.', + 'Hooks can run commands before launch, as a wrapper, or after exit. Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, $INST_JAVA_ARGS.', }, customHooks: { id: 'instance.settings.tabs.hooks.custom-hooks', diff --git a/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue b/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue index 252de30984..75ea26d984 100644 --- a/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue +++ b/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue @@ -143,6 +143,11 @@ watch(
+ Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, + $INST_JAVA_ARGS. +
+- Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, - $INST_JAVA_ARGS. + Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, $INST_JAVA_ARGS.
{{ formatMessage(messages.postExitDescription) }}
+ +- Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, $INST_JAVA_ARGS. -
-Ran after the game closes.