Very strange issue

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Very strange issue

Post by schmidtbag »

I have this old and pretty un-heard of game called Space Tripper. Its pretty fun and actually very well made, and it runs perfectly in Wine. I have 5 other games installed on my computer right now and they all start up fine when I make shortcuts for them using the:

Code: Select all

env WINEPREFIX="~/.wine" wine "C:\Program Files\Game\game.exe"
But for some reason, Space Tripper doesn't like to work with this. When I tell the game to run, Wine's desktop shows up for a couple seconds and then closes. I go to my home directory and surprisingly see this console.txt left behind, which contains:
[console] 1400 log started Fri Jun 20 22:44:59 2008
[init] init_game
*** [file] failed to fopen 'config.cfg': No such file or directory
So, I figured that maybe I just can't use the default shortcut code for Wine. So I just made a link file. That didn't do anything. I felt very suspicious why the game could only work if I run it in it's directory, and I noticed that if I right-click on the .exe and select "open with other application", and type in "wine", it doesn't start up.

What do I do? I'm almost positive on an earlier version of Wine this worked fine but I'm not sure which. If I had to guess, it'd be 0.56
Last edited by schmidtbag on Fri Jun 20, 2008 10:12 pm, edited 1 time in total.
User avatar
dimesio
Moderator
Moderator
Posts: 13368
Joined: Tue Mar 25, 2008 10:30 pm

Post by dimesio »

It's not that uncommon. Some Windows programs have to be started from the directory in which they're located. You didn't mention which desktop environment you use. In KDE, right click on the desktop link, select Properties, Application, and add the full unix path to the executable to the Work Path field. I don't know about Gnome, but I imagine the procedure is similar.
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

I am using gnome, so a lot of what you said isn't there. There must be different words for it. If Work Path is the exact directory of the executable, and the executable name itself I've already done that and it acts no different.
Tlarhices
Level 4
Level 4
Posts: 101
Joined: Sun Mar 02, 2008 9:28 pm

Post by Tlarhices »

You can try changing your script to:

Code: Select all

cd ~/.wine/drive_c/Program\ Files/Game/
wine game.exe
It should set the path correctly.
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

Does anything have to be in quotes? Also, is that backslash (\) supposed to be there? If so, what exactly is it for? I keep getting cd errors.
Tlarhices
Level 4
Level 4
Posts: 101
Joined: Sun Mar 02, 2008 9:28 pm

Post by Tlarhices »

schmidtbag wrote:Does anything have to be in quotes? Also, is that backslash (\) supposed to be there? If so, what exactly is it for? I keep getting cd errors.
The backslash is here to tell it's a space in the parameter and not 2 different parameters.

Please can you post the exact command line you are typping so I can see where is the problem ?
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

cd ~/.wine/drive_c/Program\ Files/Space\ Tripper wine SpaceTripper.exe

Terminal seems to be able to set the cd but it seems to ignore the whole game part
Last edited by schmidtbag on Fri Jun 20, 2008 10:42 pm, edited 1 time in total.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

Tlarhices wrote:You can try changing your script to:

Code: Select all

cd ~/.wine/drive_c/Program\ Files/Game/
wine game.exe
It should set the path correctly.
You can't put more then one command into .desktop file.

schmidtbag, you should ask Gnome developers to make that function available or switch to KDE. It's a mandatory part of the .desktop file format spec. And since it's a text file you can always edit it by hand.

Just add this line to the file:

Code: Select all

Path=/home/user/.wine/drive_c/Program Files/Game
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

hmm I didn't know that, thanks everyone. I'll keep you posted on whether it works or not.
Tlarhices
Level 4
Level 4
Posts: 101
Joined: Sun Mar 02, 2008 9:28 pm

Post by Tlarhices »

schmidtbag wrote:cd ~/.wine/drive_c/Program\ Files/Space\ Tripper wine SpaceTripper.exe
These are 2 commands, they need to be separated.
Either by putting them on 2 lines :

Code: Select all

cd ~/.wine/drive_c/Program\ Files/Space\ Tripper
 wine SpaceTripper.exe
Or using ampersands if you want a one line command :

Code: Select all

cd ~/.wine/drive_c/Program\ Files/Space\ Tripper && wine SpaceTripper.exe
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

Tlarhices, your 1 line-code suggestion works perfectly... in terminal. In the launcher I still get a cd error saying
"Details: Failed to execute child process "cd" (No such file or directory)".


Using gedit and modifying the .desktop file manually and adding the 2 lines just gives me an error saying it won't work.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

schmidtbag wrote:Tlarhices, your 1 line-code suggestion works perfectly... in terminal. In the launcher I still get a cd error saying
"Details: Failed to execute child process "cd" (No such file or directory)".


Using gedit and modifying the .desktop file manually and adding the 2 lines just gives me an error saying it won't work.
Correct. That's what I told you - you ca not add more then one "Exec" line into .desktop. Also you can't use shell built-ins either (at least not in Gnome).
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

so what can I do now? Am I stuck having to locate the game each time I want to play it?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

schmidtbag wrote:so what can I do now? Am I stuck having to locate the game each time I want to play it?
Again what I already said:
vitamin wrote:Just add this line to the .desktop file:

Code: Select all

Path=/home/user/.wine/drive_c/Program Files/Game
That is the "working directory". Of course modify the path to point to the palace your game is installed to.
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

I tried this:
Path='~/.wine/drive_c/Program Files/Space Tripper/SpaceTripper.exe'
and I got errors. I removed the quotes and I got errors. I tried this:
Path='~/.wine/drive_c/Program Files/Space Tripper/' wine 'SpaceTripper.exe'
and that didn't work. I also tried:
path='~/.wine/drive_c/Program Files/Space Tripper/' && wine 'SpaceTripper.exe'
with no luck

I don't mean to be a pain, but if this is a common issue I'm surprised theres no definite solution for gnome.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

schmidtbag wrote:I tried this:
Path='~/.wine/drive_c/Program Files/Space Tripper/SpaceTripper.exe'
and I got errors. I removed the quotes and I got errors. I tried this:
Path='~/.wine/drive_c/Program Files/Space Tripper/' wine 'SpaceTripper.exe'
and that didn't work. I also tried:
path='~/.wine/drive_c/Program Files/Space Tripper/' && wine 'SpaceTripper.exe'
with no luck
Wrong. You not reading what I'm telling you. "Path" is the working directory NOT a program! Also do not use "~" in the path. Put the full pathname.

schmidtbag wrote:I don't mean to be a pain, but if this is a common issue I'm surprised theres no definite solution for gnome.
It's not. If you would have installed program with Wine the link would have been created properly.
3vi1
Level 4
Level 4
Posts: 125
Joined: Sun Feb 24, 2008 8:24 pm

Post by 3vi1 »

The problem is probably, as vitamin already pointed out, you used the tilde instead of /home/username. The ~ is a shorthand in the shell, but don't expect it to be expanded by other programs.

In some cases, you can use $HOME in it's place if you don't want to hardcode the userid.
schmidtbag
Level 2
Level 2
Posts: 19
Joined: Sun May 18, 2008 2:13 pm

Post by schmidtbag »

Ooooh, I didn't know I was supposed to add the "Path=" to the .desktop. When you said stuff like "working directory" and editing the .desktop file, I thought you meant change the Exec section so it says "Path=" because I didn't see anything that said Path in the file. But now it works, thanks a lot. Sorry for the inconveniences.
Locked