MAMEHub icon indicating copy to clipboard operation
MAMEHub copied to clipboard

MAMEHub can't be launched outside of the same folder in Linux

Open Kurolox opened this issue 8 years ago • 5 comments

Using Arch Linux 4.4.1-2. When executing the .sh file outside of the folder where it's placed it throws an error. Here's an example.

I executed this from my desktop (It doesn't work):

[kuro@ArchKuro ~]$ /home/kuro/.MAMEHub/MAMEHub.sh
--2016-03-01 22:17:33--  http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar
Resolving 10ghost.net (10ghost.net)... 66.85.171.210
Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 39647727 (38M) [application/java-archive]
Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/MAMEHubRepo/Binaries/dist ~
SOUND FILE: /sounds/ding.wav
SOUND FILE: /sounds/gamestart.wav
SOUND FILE: /sounds/gamestop.wav
SOUND FILE: /sounds/playerjoin.wav
SOUND FILE: /sounds/startup.wav
Exception in thread "main" java.io.FileNotFoundException: Source 'ume.ini.unix' does not exist
    at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1074)
    at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038)
    at com.mamehub.client.MAMEHub.main(MAMEHub.java:91)
[kuro@ArchKuro ~]$ 

This is also from my desktop, but this time I cd into the folder before executing the .sh. This time it works.

[kuro@ArchKuro ~]$ cd /home/kuro/.MAMEHub/ && ./MAMEHub.sh
--2016-03-01 22:18:28--  http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar
Resolving 10ghost.net (10ghost.net)... 66.85.171.210
Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 39647727 (38M) [application/java-archive]
Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/.MAMEHub/MAMEHubRepo/Binaries/dist ~/.MAMEHub
SOUND FILE: /sounds/ding.wav
SOUND FILE: /sounds/gamestart.wav
SOUND FILE: /sounds/gamestop.wav
SOUND FILE: /sounds/playerjoin.wav
SOUND FILE: /sounds/startup.wav
Creating server...
[22:18:29,135  INFO PortOpener.java:153] ONE HOST IP ADDRESS IS 192.168.1.33
[22:18:29,137  INFO PortOpener.java:157] FORWARDING PORTS: 6805 AND 6805
Creating server...
[22:18:29,138  INFO PortOpener.java:174] Starting Cling...
Starting server
Starting server
[22:18:29,174  INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT
[22:18:29,174  INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT
[22:18:29,221  INFO AbstractConnector.java:333] Started [email protected]:6805
Blocking until shutdown
[22:18:29,221  INFO AbstractConnector.java:333] Started [email protected]:8914
Blocking until shutdown
[22:18:29,300  INFO UDPReflectionServer.java:30] SERVER: Waiting for packet
[22:18:29,316  INFO LoginDialog.java:104] Adding intro dialog

Just a minor bug, but It's really annoying because I can't make a working .desktop file properly.

Kurolox avatar Mar 01 '16 21:03 Kurolox

You can change the sh file to cd to the directory containing the sh file before starting MAMEHub. Can you submit a pull request with this change? On Tue, Mar 1, 2016 at 1:28 PM Kurolox [email protected] wrote:

Using Arch Linux 4.4.1-2. When executing the .sh file outside of the folder where it's placed it throws an error. Here's an example.

I executed this from my desktop (It doesn't work):

[kuro@ArchKuro ~]$ /home/kuro/.MAMEHub/MAMEHub.sh --2016-03-01 22:17:33-- http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar Resolving 10ghost.net (10ghost.net)... 66.85.171.210 Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 39647727 (38M) [application/java-archive] Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/MAMEHubRepo/Binaries/dist ~ SOUND FILE: /sounds/ding.wav SOUND FILE: /sounds/gamestart.wav SOUND FILE: /sounds/gamestop.wav SOUND FILE: /sounds/playerjoin.wav SOUND FILE: /sounds/startup.wav Exception in thread "main" java.io.FileNotFoundException: Source 'ume.ini.unix' does not exist at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1074) at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038) at com.mamehub.client.MAMEHub.main(MAMEHub.java:91) [kuro@ArchKuro ~]$

This is also from my desktop, but this time I cd into the folder before executing the .sh. This time it works.

[kuro@ArchKuro ~]$ cd /home/kuro/.MAMEHub/ && ./MAMEHub.sh --2016-03-01 22:18:28-- http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar Resolving 10ghost.net (10ghost.net)... 66.85.171.210 Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 39647727 (38M) [application/java-archive] Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/.MAMEHub/MAMEHubRepo/Binaries/dist ~/.MAMEHub SOUND FILE: /sounds/ding.wav SOUND FILE: /sounds/gamestart.wav SOUND FILE: /sounds/gamestop.wav SOUND FILE: /sounds/playerjoin.wav SOUND FILE: /sounds/startup.wav Creating server... [22:18:29,135 INFO PortOpener.java:153] ONE HOST IP ADDRESS IS 192.168.1.33 [22:18:29,137 INFO PortOpener.java:157] FORWARDING PORTS: 6805 AND 6805 Creating server... [22:18:29,138 INFO PortOpener.java:174] Starting Cling... Starting server Starting server [22:18:29,174 INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT [22:18:29,174 INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT [22:18:29,221 INFO AbstractConnector.java:333] Started [email protected]:6805 Blocking until shutdown [22:18:29,221 INFO AbstractConnector.java:333] Started [email protected]:8914 Blocking until shutdown [22:18:29,300 INFO UDPReflectionServer.java:30] SERVER: Waiting for packet [22:18:29,316 INFO LoginDialog.java:104] Adding intro dialog

Just a minor bug, but It's really annoying because I can't make a working .desktop file properly.

— Reply to this email directly or view it on GitHub https://github.com/MisterTea/MAMEHub/issues/372.

MisterTea avatar Mar 01 '16 21:03 MisterTea

I would love to do it, but I don't have the knowledge. Since I know where I placed my folder and how It's called I can cd to it editing the .sh file, but I can't do anything that would work system-wide regardless of the name of the folder and the location.

I apologize for it. At least I can confirm that if you cd to the directory editing the .sh file it works properly.

Kurolox avatar Mar 01 '16 21:03 Kurolox

Here's the knowledge: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in

You can use that one-liner to get the directory of the sh file regardless of how you call it. Please submit a pull request with the fix, thanks!

On Tue, Mar 1, 2016 at 1:50 PM Kurolox [email protected] wrote:

I would love to do it, but I don't have the knowledge. Since I know where I placed my folder and how It's called I can cd to it editing the .sh file, but I can't do anything that would work system-wide regardless of the name of the folder and the location.

I apologize for it.

— Reply to this email directly or view it on GitHub https://github.com/MisterTea/MAMEHub/issues/372#issuecomment-190921743.

MisterTea avatar Mar 01 '16 21:03 MisterTea

I just googled it for the last 15 minutes and you found it in 30 seconds or so. I'm impressed. I'll submit the fix tomorrow. Here is a bit late and I should sleep a bit.

Kurolox avatar Mar 01 '16 21:03 Kurolox

you can use this script http://pastebin.com/CPEK2bvS

Jaku2k avatar Mar 28 '16 09:03 Jaku2k