Install other modules from hook_install Is it possible to run command of the same functionality as drush pm-download from hook_install or hook_update_n? If not, what other alternative solutions do I have to automatically download and install modules and dependencies from a custom site deployer module?
Is it possible to run command of the same functionality as drush pm-download from hook_install or hook_update_n?


If the web server user has permissions to write to the modules folder (which is in itself a security risk), then yes, you can do that. Writing it wouldn't be trivial, of course, but you can get a lot of the necessary code from Drush.

If the web server user doesn't have permissions to write to the modules folder, then no, it's not possible.


  If not, what other alternative solutions do I have to automatically download and install modules and dependencies from a custom site deployer module?


If your web-server is properly secured, then your only option is to invoke the script (whatever form that may take) as a user with sufficient privileges.