My application has a single-app instance logic in it. The source is browsable from the link in my sig. I have made it the way it is so that it works without dbus dependencies, because I need it to work in Windows as well.