If I've got cf-upgrade in my $PATH, the command I typed may see argv[0] = "cf-upgrade" which isn't going to be useful to you when you want to copy the file; this is the "no path at all" case I mentioned above.  It's entirely possible all supported platforms do in fact add a path to the binary when it's invoked like that, I just don't know that this is the case ...