I completed my PhD last year and now work in industry. Nevertheless I've continued to work privately on my MSc and PhD thesis' work and lately I've been getting stellar results on the work I did for my MSc thesis. (My thesis work is unrelated to my current employment.) The results have undeniable commercial potential which I hope to explore; yet perhaps because I've spent so much time in academia, I have the urge to publish. I'm keenly aware that publishing has the risk of ceding my competitive advantage to potential competitors, yet I know of a couple of academics who both publish state of the art research in the area of their growing businesses. Therefore I suspect that under some circumstances it is possible to be involved in enterprise and publish, although I'm not sure what those circumstances are.
I'd appreciate your thoughts on this issue. When is it okay to publish when doing enterprise?
Edit: my question is not about whether it is okay to publish if outside academia. Rather, it's about when its okay to publish research that is being seriously considered for a (future) commercial product.
The results have undeniable commercial potential
You don't mention which industry you work in, but within the industries I'm familiar with, companies own everything that comes out of their employees' brains. By default, your ideas, techniques, code, and results are almost certainly the property of your employer—even if you developed them at home on your own time using your own personal equipment— and they may not be inclined to let you exploit them commercially. Read your employment contract very carefully.