How to deal with module conflicts ("anti-dependencies")? I have a module that specifically doesn't work with another module. I want to know if there is a way to check if that module is enabled and abort installation for example or gray out the installation box so that my module can only be installed if that other module is disabled.

It's like inverse dependencies!

Is there any way of doing this properly in Drupal?
The module just needs to implement hook_requirements(); a requirement could be that a module is not installed, and if the module returnes an error from hook_requirements(), then it will not be installed.

The module should implement code similar to the following one:

function mymodule_requirements($phase) {
  $requirements = array();
  // Ensure translations don't break at install time
  $t = get_t();

  if ($phase == 'install') {
    if (module_exists('other_module')) {
      $requirements['mymodule'] = array(
        'title' =&gt; $t('My module'), 
        'value' =&gt; $t('My module is not compatible with Other module.'), 
        'severity' =&gt; REQUIREMENT_ERROR, 
      );
    }
  }

  return $requirements;
}