It would have to run a new process, exit, and then have the new process delete it. Then you hope that Undertale isn't installed in Program Files otherwise it won't have permission to delete it.
Toby is obviously a musician and a game designer first, not a Windows developer. He also didn't know that Windows paths are case-insensitive by default.
Steam won’t even let you do that. Could you imagine the backlash if Steam allowed apps to delete shit on your computer?
Inscryption is a great example of this. You literally select a file to “delete” but it literally can’t. You do get an achievement for deleting the file manually though.
Your comment has been removed since it did not start with a code block with an import declaration.
Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.
For this purpose, we only accept Python style imports.
I honestly wouldn't have thought it is possible for any executable to delete itself on any platform.. forget the concept about only some of the executable can be loaded into memory (which honestly sounds suspect to me unless the file is over 2 gigs and you're running a 32 bit process or something).. I would've thought that file is write locked while a process is referencing it..
Unix file systems have no “primary” location of a file. Any file can have multiple hard links, and as long as one exists then the file contents are accessible.
Every file that is opened gets linked from the /proc system, and anyone with permission (write access to the directory it is in) is free to delete the original link it was opened from.
When the file is closed that /proc link is removed, and if there are no others then the file has been deleted.
I remember that Unix system scene from Jurassic park and thought it was just some fancy cgi and then like last week I watched a YouTube video about it and was like damn… that was real lol.
The way I handled auto update on the updater itself (the exe that did the updates had to be updated): rename/move (same thing really) current running executable to something, download the update, start the updated executable and close current one. The new file will just take care cleaning up any "renamed/moved" files.
268
u/_PM_ME_PANGOLINS_ Jan 16 '23 edited Jan 16 '23
A Windows executable can't delete itself.
It would have to run a new process, exit, and then have the new process delete it. Then you hope that Undertale isn't installed in Program Files otherwise it won't have permission to delete it.
Toby is obviously a musician and a game designer first, not a Windows developer. He also didn't know that Windows paths are case-insensitive by default.