PDA

View Full Version : Possible to fetch MAYA_SCRIPT_PATH without using Maya?


JakobWelner
11-09-2005, 06:42 PM
Hey.
I'm working on a new installer for OMT now and I need a way to fetch the script path environment variable in order to located already used userSetup.mel files if any, to get OMT to work with other scripts which are using userSetup.mel (fx. bonus tools)
Is this possible? any env file that contains the neede information or something like it? or can I just forget about it, and stick to a MEL installer from where you have all the neede env settings just at hand.

Anyone who knows anything about this? please help, as we want to release a working installer asap.

sunit
11-09-2005, 07:42 PM
why not parse through the Maya.env in the userprofile/maya/mayaX.X/ directory? i'm not sure about grabbing windows env variables, but it's been pretty standard at a most of the places i've worked to modify the Maya.env instead.

there may be some finicky parsing, though, since you can define paths in the Maya.env using variables($). i don't know where the syntax comes from, though - it's not mel....

-sunit

JakobWelner
11-09-2005, 10:55 PM
Hey sunit. The problem is that as default, the Maya.env is empty and only contains user entries, and as I need the path to check up on every existing userSetup file, both the custom paths and the standard are needed.
Anyhow, I know how to fetch the list now on linux, and I've heard that something with the "set" command on windows should do the same, but it turned out a bit more complex then i had hoped. It was meant for one of my friends who suggested that he would make an installer in python and compile it for windows so it would be nice and easy to execute, but I'm beginning to doubt that it's better to have it in python compared to MEL.. the MEL script just needs a bit of debugging (or a lot!) and a few new features that secures the installation process a bit more, and I think it will fit fine.

I'm thinking of installers like:
1) You browse to our website using mayas webbrowser and clicks the installation link. The files are written to your harddrive at the desired location and everything is automatically set up right... this should be possible using only text files and provided that you can execute whole script files from the browser - which I havn't gotten working yet. But it'll get tricky once plug-ins starts to come by.
2) Simply download the toolbox and open the install.mel file in Maya from where it prompts for the location of the toolbox and which versions of Maya you want it installed in (provided that you have more then one version installed). It then writes the appropriate module file(s) and userSetup(s) and OMT is good to go.

The only problem is that I try to make it installable for users with non-administrator permissions, and as bonus tools gets installed into maya's installation dir, many users wont have write permissions for the userSetup bonus tools in there. This becomes a problem when you write the userSetup for OMT, as it - being in the users home dir - get's higher priority then the one bonus tools are using, which removes bonus tools from your maya menu.
The only workaround for this, I think, is to copy the content of the bonus tools userSetup into the newly created OMT userSetup, which seems a bit stupid :P

this turned out as a whole installer topic instead of concerning env variables.. sorry for that.

sunit
11-09-2005, 11:24 PM
ah...bonus tools. does it also install the scripts into maya's installation dir?

it seems more reasonable to expect users to modify their own userSetup.mel. is it likely that users will both 1) not have administrator privileges, and 2) have bonusTools installed into the maya installation dir? is this only a maya7.0 scenario? i don't recall bonusTools installing into the installation dir on previous versions...

-sunit

JakobWelner
11-10-2005, 07:05 PM
Yes, bonus tools installs the scripts, plugins and more in the installation dir as well and it's only with Maya 7.0 / bonus tools 7.0 caused by the new installer. Wonder how it handles installations with non-admin permissions. Have anyone tried this? I'm quite curious!

I know that some companies uses a global userSetup.mel which searches for a localUserSetup in the users local domain. This enables having more then one file functioning as a userSetup without overruler each other, but needs som code to be added to the primary userSetup.mel :( . This could be a neat feature to have as default in Maya, but I dont recon it's there now, is it?

As for the scenario with non-admin privileges and having bonus tools 7.0 installed, I bet it will happen, and I better take care of it now instead of having to edit the installer once again cos of some complains.

It might be best if the installer prompts for what it is about to do while giving the user some custom installation options.. can't see any other ways of handling global and write protected userSetups which should keep on being so... but please save my day with the allmighty answer of life, the universe and everything!

...and '42' wont do this time :(

JakobWelner
11-10-2005, 10:49 PM
seems that bonus tools 7 wont install if you havn't got admin permissions and if it happens that you have the right permissions, another existing userSetup in your local dir will overrule it as default, så you wont see it in the menu until you copy the bonus tools userSetup content into your local.
This could confuse users using MJPolyTools, OMT or any other tool which requires a custom userSetup.
Seems a bit weird that they havn't thought of that, I think.
Or is it just me?

CGTalk Moderation
11-10-2005, 10:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.