Hello fellow developers,
Right now, during one of my creative insomnia sessions I've been working on a project of mine while learning C# and I happened to wonder - is there a way to create a self-deleting application ?
Now, do not mistake me for someone who's too lazy to do his research. I've done some experimenting of my own (well, not much of experimenting really, as File. functionality did not seem to be capable of such a task - not surprising, windows is fairly reluctant when it comes to delete an application that's running).
I did a bit of research and turns out some of my fears were true - such functionality would need to either execute a command line process or the MOVEFILE_DELAY_UNTIL_REBOOT flag. The second option is absolutely out of question while the first one is still somewhat messy. Therefore I'm just curious - have any of the more experienced CSharp developers around here found another way to do it ? (Theoretically, it does sound impossible. But I would be foolish to underestimate fellow developers)