So what happened was…

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

  1. The uninstall string I set for the program in the registry passes the argument “uninstall” to my program.
  2. My program takes the argument and knows it’s about to uninstall itself. It then asks for admin access.
  3. Once achieving admin access, it then copies itself to a temporary directory. This is the TEMP path in Windows.
  4. 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”.
  5. The program knows since it got passed an argument with a path to delete it and uninstall registry keys and the like.
  6. However, the path I passed was not verbatim. Therefore, the arguments passed looked like this: uninstall C:/Program Files/Searchifier/searchifier.exe
  7. 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.
  8. My program receives three arguments:
    1. uninstall
    2. C:/Program
    3. Files/Searchifier/searchifier.exe
  9. 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.
  10. 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.
  11. It then calls a recursive delete function on “C:”.
  12. 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

2 thoughts on “So what happened was…”

Leave a Reply

Your email address will not be published. Required fields are marked *