I'm currently using a temp folder for my Java application to create a lock so that only one instance can be running at a time. This lock file MUST be deleted when the program exits.
This is fine, except for the case when the process is killed (not allowed to shutdown normally, e.g. from Windows Task Manager). If that happens, the user will never be able to run the program again... eek
Anyone have a suggestion? Is there a way to make the OS delete a folder on reboot or something similar? Should I find another way to have a "single instance lock?"
Also, the solution should be cross-platform if possible...