Okay, so this is an update of what happened with the whole “I accidentally wiped my entire hard drive”.
The Non-Techie Version
If you don’t know much about computers, read this.
I accidentally told the program that the folder it should delete was my main hard drive when it was uninstalling itself. Not much else to it.
The “I know that arrays start at 0” Version
- The uninstall string I set for the program in the registry passes the argument “uninstall” to my program.
- My program takes the argument and knows it’s about to uninstall itself. It then asks for admin access.
- Once achieving admin access, it then copies itself to a temporary directory. This is the TEMP path in Windows.
- The original program starts the copy of itself with two arguments: “uninstall”, and the path of the original. In this case, it was “C:/Program Files/Searchifier/searchifier.exe”.
- The program knows since it got passed an argument with a path to delete it and uninstall registry keys and the like.
- However, the path I passed was not verbatim. Therefore, the arguments passed looked like this: uninstall C:/Program Files/Searchifier/searchifier.exe
- This caused a massive problem. Since there is a space between ‘Program’ and ‘Files’, Windows feeds that to my program as THREE separate arguments, not two.
- My program receives three arguments:
- The program only cares about the first two. It knows it’s going to uninstall itself, so first it tries to delete the file at the location “C:/Program”. This fails, but the program continues on.
- It next attempts to delete the directory at which the program resides. To do this, it gets the parent folder of the path it just tried to delete. This is… the C: drive.
- It then calls a recursive delete function on “C:”.
- I then spend the next 6 days in deep depression trying to recover all my files. 🙂
With that, SEARCHIFIER is now out! I’ll make another post about this later as well, but it’s now officially [HERE].
My Patreon | My Website