Self-destructing application

desktop-application, java, self-destruction

Solution

It is possible. To get around the lock on the JAR file, your application may need to spawn a background process that waits until the JVM has exited before deleting stuff.

However, this isn't bomb-proof. Someone could install the application and then make the installed files and directories read-only so that your application can't delete itself. The user (or their administrator) via the OS'es access control system has the final say on what files are created and deleted.

Problem

Along the lines of "This tape will self-destruct in five seconds. Good luck, Jim"... Would it be possible for an application to delete itself (or it's executable wrapper form) once a preset time of use or other condition has been reached? Alternatively, what other approaches could be used to make the application useless? The aim here is to have a beta expire, inviting users to get a more up-to-date version.

Original source

Related problems