The "adjustments" made to my previous patch to remove a trailing .exe from get_progname()'s result broke it. The attached patch, which I have tested, fixes the breakage.
cheers
andrew