Self destruct your application?

Dude, have you ever heard of backups??? Even if you manage to delete
the code, they can always deploy it again. That's what the
entertainment industry is suffering to understand...

This is typically not a technology problem. You have to resolve it by
other means. James' suggestion bellow is very good. Another
alternative is to provide services, not products. That is, host the
solution. Finally, if you really want to solve this using technology,
I would try to use encryption. Perhaps something along the lines of
Zend Guard (http://zend.com/en/products/guard/) in the PHP world.

Best regards, Ricardo