Short lessons:
) Strike out the contract part about rights for books after 1st one
) Beware of how fast projects that you cover move
) Put the source code on Github
) Have a blog where you write about your discoveries that don't fit into the book
) Ask for discount codes and throw them around; that may be the only marketing _anybody_ will actively do for the book...
) If you are doing the first book after all, make sure you are treating it as something you will leverage multiple times after that ("published author", increased chance of presenting, proof you can write a different book for a better publisher, etc).

Background and happy/sad story:
I wrote my first book for Packt (on Apache Solr). It was a small beginner-oriented book (about 64 pages of real content). I wanted to write a book for long time, so when they approached me to do it about a popular open source project I was working with and blogging about, I jumped on it. I figured that a small book would be perfect way to see the book process end-to-end.

It did not take _too_ much time, but longer than I expected (of course). However, support from Packt for the process was terrible, both in terms of initial information, explanations of process stages, reviews, formatting support or marketing.

I believe I did a good job _despite_ that as I wrote tutorials before as well as working in a senior tech-support position, which gave me visibility into research and explanation techniques.

Still, they managed to nearly destroy my book by publishing a free sample chapter from another book on the same topic that overlapped by the topic-name with my single-focus work. The technical content was actually complimentary and used very different explanation approach, but the general titles looked similar. The beginners (target audience) would certainly be confused. Packt did not realize they were publishing both books at the same time. They did not realize they created a conflict. And they did not see a problem until I escalated the issue 3 levels up all the way out of India into the UK level of management. They replaced the free chapter in the end.

Then they screwed up on the pricing and - just after release - accidentally moved the decimal point and made my book 10x priced. For several weeks while I notified, begged, and - relatively politely - escalated.

In the end, I pushed really hard repeatedly and am happy with what I got. I just feel it happened despite the publisher, not because of them. The book is now obsolete, but a couple of people keep buying it, despite Packt increasing the price on it for some reason. Overall, I got a couple of thousands out of that. A good chunk of that was actually not from individual sales but from some sort of global subscription (perhaps via O'Reilly Safari library).

Later, I also reviewed a couple of other Packt books, supposedly on the same subject. Or I tried to review. They were so bad I could not even start providing viable feedback. So, I pulled out. Yet, I think they all got published. (Yes, I understand what this may REALLY mean about my own book. If anybody wants to privately review and provide honest feedback on an outdated Solr book, let me know.)

I also had a go at Leanpub and O'Reilly. The topic for Leanpub book was too big for me and I cancelled it, refunding all the money back (Leanpub were awesome at that slightly-complicated logistics).

Current O'Reilly book is probably too big as well. Solr is moving way too fast to do anything but small books on with classic publisher schedule and update capabilities. I am not the first one who hit that problem and I know of another book about Solr that got cancelled when the page count went into the second thousand.... I tried to get my scope smaller, but the things are still changing faster than I can process them, never mind explain.

My current thinking is that it may make sense to go back to Leanpub and do super-focused micro-book that is absolutely up-to-date. Something like Solr mega-tutorial with all bits working and using latest features and command lines. Sell it for 4.95 with discount to my mailing list subscribers (yes, I built one). Update it as Solr updates, do other micro-guides, etc.