If your Maya add-on consists of a single file, such as a single plug-in, a single script file or a single icon, then it generally makes sense to simply distribute the file itself, possibly in compressed format, and have the end user copy it into the appropriate directory.
For example, if a user wishes to install a plug-in, written in either C++ or Python, they can do so simply by copying the plug-in file to one of the directories in their MAYA_PLUG_IN_PATH environment variable.
At sites where multiple users may need to use the same plug-in, it is often preferable to install it in a common directory to which all users have access, such as a directory on a network drive, rather than have each user install it separately. This makes it much easier for the site administrator to apply any new versions of the file which might later be released.
For a common directory to work for all users, it must appear in the MAYA_PLUG_IN_PATH for all users. By default, MAYA_PLUG_IN_PATH contains both user-specific and system-wide directories. The system-wide directories can be further subdivided into those whose paths are fixed and those whose paths are relative to the location where Maya is installed. For example, Maya 2017 on Linux has the following system-wide directories in its MAYA_PLUG_IN_PATH:
The first two paths are the same regardless of where Maya is installed, but the third path contains /usr/autodesk/maya/2017 which is the top of the directory tree where Maya is installed. Had Maya been installed in /opt/maya2017 then the first two paths would still be the same as shown above but the third would become:
This suggests several approaches to making the plug-in available to all users:
These same approaches will also work with MEL or Python script files, except that instead of using MAYA_PLUG_IN_PATH scripts must be installed into a directory in the user's MAYA_SCRIPT_PATH environment variable. Similarly, icons must be installed into a directory in the user's XBMLANGPATH environment variable and presets must be installed into a directory in the user's MAYA_PRESET_PATH.
To see what directories each environment variable is set to, use the getenv command in the Maya Script Editor or Maya command line as follows:
getenv MAYA_PLUG_IN_PATH
You can also set an environment variable to a directory of your choice. To do so, you must create a Maya.env file.
For more information about the Maya.env file, including the location to which it should be saved on each platform, see Setting environment variables using Maya.env.