Weird application folder problem.

Im having a problem its like this:
whenever I run an application from folder such as a folder like: pong.
and there is a pong exectuable and a pongmenu.tga,when I click pong run it, it says missing pongmenu.tga. but it’s right there. when I open terminal type ./pong run it,everything works fine, and it even happens when I use wine,directly run by click say mame.exe it complain about missing files again!, but it gone when I am using wine mame.exe in terminal again. what is causing that problem ? it’s so weird? thanks for help.

Im having a problem its like this:
whenever I run an application from folder such as a folder like: pong.
and there is a pong exectuable and a pongmenu.tga,when I click pong run it, it says missing pongmenu.tga. but it’s right there. when I open terminal type ./pong run it,everything works fine, and it even happens when I use wine,directly run by click say mame.exe it complain about missing files again!, but it gone when I am using wine mame.exe in terminal again. what is causing that problem ? it’s so weird? thanks for help.
Sounds like the problem is the working or default folder is not changed just because you can find it in a file manager. When you run a terminal session and change to its folder, it is now the default, at least when it was ran. You will notice that for any program in your menu, you can define a work path which is the default folder when you start the application, like doing a cd work path before running the application. Consider creating a menu entry to start the program, putting in the work path and you could then put that icon on your desktop.

Thank You,

thanks, with your hint, I solve the problem with wine by open exe with command:
”wine start /Unix“ instead of “wine”
but with linux executable,I couldn’t find a way to solve that problem, I use kdevelop to compile a lot of small apps.and some of( a lot of) them are basically just for test purpose. so there might be a way, open all linux executable with a sh script but I don’t know how to get $1 script parameter’s directory and I don’t know if this is a dead end or there my be a more simple way to set work directory of current executable to the folder which I just clicked.

thank you again for your help:)

On 2011-06-16 10:36, allked wrote:

> … but I don’t know how to get $1
> script parameter’s directory and I don’t know if this is a dead end or
> there my be a more simple way to set work directory of current
> executable to the folder which I just clicked.

With a script, yes.

The full path and name is in $0. You have to remove the file name, and you
get the path.

man basename, man dirname

However.

It is not customary for programs to work in the same directory as they are:
that’s an MsDos/Windows practice. Programs reside in directories like /bin,
/usr/bin, /home/username/bin, and data files reside elsewhere.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

thanks, with your hint, I solve the problem with wine by open exe with command:
”wine start /Unix“ instead of “wine”
but with linux executable,I couldn’t find a way to solve that problem, I use kdevelop to compile a lot of small apps.and some of( a lot of) them are basically just for test purpose. so there might be a way, open all linux executable with a sh script but I don’t know how to get $1 script parameter’s directory and I don’t know if this is a dead end or there my be a more simple way to set work directory of current executable to the folder which I just clicked.

thank you again for your help:)
If you can do it manually, we can automate it. If you need to extract a files location in order to change to its folder, we can do that. Just give me an example of how you are doing it manually right now.

Thank You,