You should really not rely on being able to locate where the actual executable is.
If you really need to know this at runtime, then save it in some config file (when installing the program) on a location (eihter global or local, depending on your needs) that is custom for the OS you're using (see GetAppConfigDir).
Bart