Ubuntu 14.04 LTS
I am trying to create a Launcher for a program who runs in wine. Problem is this program is launched through a file loader.exe, which appears to be "location sensitive" meaning that it works or not depending on where it is called from. I have never encountered such odd behavior before and I am baffled.
Example:
If I create a Link to loader.exe (right click --> Make Link) the link will work as long as it is in the same folder as loader.exe, but if I move the link to another folder, loader.exe fails. For this reason I cannot even create a .desktop file to run loader.exe as it exhibits same behavior as the link.
So I have tried running loader.exe in the terminal. If I cd to its location and the run it, the program starts just fine:
user@PC:~$ cd /home/user/program
user@PC:~/program$ wine loader.exe
But if I try to launch it by path the program fails:
user@PC:/$ wine /home/user/program/loader.exe
So I got the idea to create a bash file (script.sh) placed into the same folder as loader.exe thinking this way I can run the bash script from anywhere, and the bash script will execute the loader.exe files from within its folder...
I tried two versions of the script:
#!/bin/bash
wine /home/user/program/loader.exe`
exit
and
#!/bin/bash
wine loader.exe
exit
Both versions fail if I run them clicking on them (or right click --> open with Run software)
Running the scripts from terminal, both versions have same behavior described previously. So if I cd to the program folder and then run the script, this works fine and launches the loader.exe (which runs the program), but if try to run the scripts with absolute path both versions fail.
I think the only option I have left is to create a script which will 1) open a terminal 2) cd to the the location of loader.exe and 3) run it (and then possibly close the terminal window as this seems to have no effect on the running software).
But I have no idea if and how this can be done. Any help would be greatly appreciated.