Prevent enabling module if private streamwrapper not set I need to create a subdirectory in the private files folder. I can check if the folder is available with variable_get('file_private_path', FALSE) in hook_install or hook_enable. 

But how can I prevent my module from getting enabled? And preferably, I want hook_uninstall to run in case this happens so that the user can first setup the private files directory and then try again.

I played with module_disable and drupal_uninstall_modules, but (understandably) those don't seem to work if they target the module they are called from. I'm using Drupal 7.
The hook_requirements(), what do you need.

Implement it your own modules .install phase. Here is an example from one of my module: http://drupalcode.org/project/jquery_localscroll.git/blob/refs/heads/7.x-1.x:/jquery_localscroll.install#l20