It depends on your goals for your book; are you trying to make money, to be known in the domain, etc... ?
For me, I was working on a wine-related software project but I had all of these notes that I had accumulated over the years and I felt like they needed to be better organized.
My original plan was to write a series of blog posts, but I ended up self-publishing the book on Amazon (under the title Essential French Wine) and it's had a modest success (but quite unexpected since I didn't put any effort into marketing it).
So if you are just trying to write a book just go and do that, don't waste time on other things...
On the other hand if you are trying to know good strategies for book marketing or to get published, I don't think writing should be your primary concern but rather getting yourself known (building an audience) and that depends very much on where your audience hangs out.