Can an add-on be automatically installed and enabled?
Part 1. Your user script paths

&gt;&gt;&gt; bpy.utils.script_path_user(
script_path_user()
returns the env var and falls back to home dir or None
&gt;&gt;&gt; bpy.utils.script_path_user()
'/home/batfinger/.config/blender/2.76/scripts'


And the addons paths

&gt;&gt;&gt; bpy.utils.script_paths(subdir='addons')
['/home/batfinger/src/BlenderGIT/qtcreator_build/bin/2.76/scripts/addons',
 '/home/batfinger/.config/blender/2.76/scripts/addons',
 '/home/batfinger/src/Blend4Web-master/blender_scripts/addons']


Part 3.

Look in scripts/modules/addon_utils.py

from the console

&gt;&gt;&gt; from addon_utils import enable
&gt;&gt;&gt; enable(
enable(module_name, default_set=False, persistent=False, handle_error=None)
Enables an addon by name.
:arg module_name: The name of the addon and module.
:type module_name: string
:return: the loaded module or None on failure.
:rtype: module


To enable my sound drivers addon for instance

enable("sound_drivers")


Check out the source, there are other handy addon utils in there.

and for part 4, there's the operator to save user prefs.

 bpy.ops.wm.save_userpref()