Get LaunchInformation in tk-multi-launchapp hook


I have a ‘’ script for managing our Rez environment. It’s located inside ‘tk-multi-launchapp’ and configured in ‘’ as ‘hook_app_launch: “{config}/tk-multi-launchapp/”’.

Here, I would like to retrieve the ‘LaunchInformation’, specifically the environment variables collected and returned in the ‘’ (‘return LaunchInformation(exec_path, args, required_env)’). I need access to ‘required_env’.

I’ve attempted to use the ‘sgtk.platform’ functions, but I’m unable to access the platform or the engine from this context. Any suggestions?

Thanks in advance!



Very good question! I’m also curious about the answer!

1 Like

I believe by the time the before_app_launch hook is executed, the LaunchInformation’s required_env dict is merged into os.environ. So you should have full access to those variables through the standard os.environ dict.

You can read step by step through this private _launch_app method.

Loosely, this is what seems to be happening:

  1. os.environ and sys.path are stored.
  2. the prepare_launch method from an engine’s is called.
  3. the LaunchInformation’s required_env is merged into os.environ.
  4. the before_app_launch hook is called. (Users can perform any modifications to os.environ here.)
  5. the app_launch hook is called and should start the application passing os.environ as the applications environment.
  6. os.environ and sys.path for the current python process are restored.
1 Like