Alternatively you could have post-install drupal_set_message() that prompts the user to visit call the batch operation manually (similar to when content access permissions need to be rebuilt via admin/content/node-settings). Use variable_get()/variable_set() once the batch has run to disable the message.<br>
<br><div class="gmail_quote">On Wed, Sep 29, 2010 at 12:44 PM, Lin Clark <span dir="ltr">&lt;<a href="mailto:lin.w.clark@gmail.com">lin.w.clark@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>Hi all,</div><div><br></div>Is using Batch API from hook_install discouraged?<div><br></div><div>On installation, my module retrieves 9 files from the Web, parses them, and enters some information into the database. I wanted to use Batch API to do this.</div>

<div><br></div><div>It is working in the Web interface, but when I try to enable my module with Drush, I get the following error</div><div><div>WD php: Warning: Cannot modify header information - headers already sent by      </div>

<div>(output started at /drush/includes/drush.inc:797) in</div><div>drupal_goto() (line 677 of /drupal-head/includes/common.inc).</div><div><br></div><div>I wanted to use Batch API because some people with slower connections might have timeout problems when retrieving the files and because it is a neat way to tell the user what is happening. </div>

<div><br></div><div>Is there another way I should be doing this?</div><div><br></div><div>Thanks,</div><div>Lin</div><br>-- <br><div>Lin Clark</div><div><a href="http://www.deri.ie/" target="_blank">DERI, NUI Galway</a></div>

<div><br></div><div><a href="http://lin-clark.com" target="_blank">lin-clark.com</a></div><div><a href="http://twitter.com/linclark" target="_blank">twitter.com/linclark</a></div><br>
</div>
</blockquote></div><br>