{"id":214,"date":"2018-06-07T19:47:12","date_gmt":"2018-06-08T03:47:12","guid":{"rendered":"http:\/\/gmrgames.com\/blog\/?p=214"},"modified":"2022-02-07T17:55:21","modified_gmt":"2022-02-08T01:55:21","slug":"so-what-happened-was","status":"publish","type":"post","link":"https:\/\/rose.dev\/blog\/2018\/06\/07\/so-what-happened-was\/","title":{"rendered":"So what happened was&#8230;"},"content":{"rendered":"<p>Okay, so this is an update of what happened with the whole <a href=\"https:\/\/gmr.dev\/blog\/2018\/05\/31\/i-never-thought-this-would-be-me-but\/\" target=\"_blank\" rel=\"noopener\">&#8220;I accidentally wiped my entire hard drive&#8221;<\/a>.<\/p>\n<h3><strong>The Non-Techie Version<\/strong><\/h3>\n<p><em>If you don&#8217;t know much about computers, read this.<\/em><\/p>\n<p>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.<\/p>\n<h3>The &#8220;I know that arrays start at 0&#8221; Version<\/h3>\n<ol>\n<li>The uninstall string I set for the program in the registry passes the argument &#8220;uninstall&#8221; to my program.<\/li>\n<li>My program takes the argument and knows it&#8217;s about to uninstall itself. It then asks for admin access.<\/li>\n<li>Once achieving admin access, it then copies itself to a temporary directory. This is the TEMP path in Windows.<\/li>\n<li>The original program starts the copy of itself with two arguments: &#8220;uninstall&#8221;, and the path of the original. In this case, it was &#8220;C:\/Program Files\/Searchifier\/searchifier.exe&#8221;.<\/li>\n<li>The program knows since it got passed an argument with a path to delete it and uninstall registry keys and the like.<\/li>\n<li>However, the path I passed was not verbatim. Therefore, the arguments passed looked like this: uninstall C:\/Program Files\/Searchifier\/searchifier.exe<\/li>\n<li>This caused a massive problem. Since there is a space between &#8216;Program&#8217; and &#8216;Files&#8217;, Windows feeds that to my program as <em>THREE<\/em> separate arguments, not two.<\/li>\n<li>My program receives three arguments:\n<ol>\n<li>uninstall<\/li>\n<li>C:\/Program<\/li>\n<li>Files\/Searchifier\/searchifier.exe<\/li>\n<\/ol>\n<\/li>\n<li>The program only cares about the first two. It knows it&#8217;s going to uninstall itself, so first it tries to delete the file at the location &#8220;C:\/Program&#8221;. This fails, but the program continues on.<\/li>\n<li>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&#8230; the C: drive.<\/li>\n<li>It then calls a recursive delete function on &#8220;C:&#8221;.<\/li>\n<li>I then spend the next 6 days in deep depression trying to recover all my files. \ud83d\ude42<\/li>\n<\/ol>\n<p>With that, SEARCHIFIER is now out! I&#8217;ll make another post about this later as well, but it&#8217;s now officially [<a href=\"https:\/\/gen3vra.github.io\/searchifier\/\" target=\"_blank\" rel=\"noopener\">HERE<\/a>].<\/p>\n<hr>\r\nIt helps me if you share this post\r\n<br\/>\r\n<br\/>\r\nPublished 2018-06-07 19:47:12 ","protected":false},"excerpt":{"rendered":"<p>Okay, so this is an update of what happened with the whole &#8220;I accidentally wiped my entire hard drive&#8221;. The Non-Techie Version If you don&#8217;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 &hellip; <a href=\"https:\/\/rose.dev\/blog\/2018\/06\/07\/so-what-happened-was\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">So what happened was&#8230;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-214","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts\/214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/comments?post=214"}],"version-history":[{"count":2,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts\/214\/revisions"}],"predecessor-version":[{"id":1199,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/posts\/214\/revisions\/1199"}],"wp:attachment":[{"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/media?parent=214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/categories?post=214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rose.dev\/blog\/wp-json\/wp\/v2\/tags?post=214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}