fix bugs and support spaces in paths as input, using short filenames as output to installer; reorder scripts so that linux and windows versions are as similar as possible (JBDS-2715)