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”.
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.
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.
Also, it looks like Maya sets its own env var as well MAYA_LOCATION.
For me on Mac that returns /Applications/Autodesk/maya2021/Maya.app/Contents, I’m not sure what it would give you on Windows.
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.