autodetect executable path

Will only work in a few cases, but can be generalizable