Get DCC executable from hook


Is it possible to get the DCC executable that was used to launch the app from inside a hook? For example, if the hook is being executed in Maya 2018, the executable I’m looking for would be “C:\Program Files\Autodesk\Maya2018\bin\maya.exe”.



You can get the path in the “app_launch” hook for the tk-multi-launchapp.


Hi @Patrick, thanks for the reply. As far as I understand, to execute the app_launch hook I already need to know the app_path:

def execute(self, app_path, app_args, version, engine_name, **kwargs)

My situation is that I’m in a custom hook that doesn’t inherit from AppLaunch and I want to find out the executable that was used to start the DCC given that I know the custom hook parent’s engine, context, etc.

Any ideas?

1 Like

Use the hook I suggested and stick the value in an env var that you can then query from your other hook. The env var set when you app_launch should persist to your other hook.


Good idea, thanks @Patrick :slight_smile:

1 Like

Also, it looks like Maya sets its own env var as well MAYA_LOCATION.
For me on Mac that returns /Applications/Autodesk/maya2021/, I’m not sure what it would give you on Windows.

1 Like

Thanks for the input @philip.scadding. On Windows it gets you “C:/Program Files/Autodesk/Maya20XX” so it doesn’t get you the executable. Also, I needed a DCC-agnostic solution so I’ve gone with setting a custom environment variable in the AppLaunch hook.