Closed nerijus closed 9 years ago
well. In general, setting Pre run to "/usr/bin/fuseiso /path/to/image.iso /mnt/cdrom" should work.
run_string.append(" /bin/sh -c \"");
run_string.append(script_path);
run_string.append("\" 2>&1");
So it will be converted to string like:
/bin/sh -c "/usr/bin/fuseiso /path/to/image.iso /mnt/cdrom"
Note, that if you are using quotes inside 'Pre run', it will break the logic.
Anyway I will need more details: Try to enable q4wine's logging subsystem, you should get the error message if 'Pre run' fails.
From the log: App STDOUT and STDERR output: /bin/sh: /usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom: Toks failas ar aplankas neegzistuoja
it means file or directory does not exist.
hm. ok. can you show me full run string please? (should be displayed in log as well)
All output with LANG=C: Exit code: 32512 App STDOUT and STDERR output: /bin/sh: /usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom: No such file or directory
But, when I run /usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom or /bin/sh -c "/usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom" from the terminal, it works.
I modified the source to output run_string too:
--- wineobject.cpp.orig 2013-12-16 23:02:55.000000000 +0200
+++ wineobject.cpp 2014-12-25 13:39:12.045774874 +0200
@@ -390,6 +390,10 @@
stdout.append("\n");
stdout.append(QString("%1").arg(status));
stdout.append("\n");
+ stdout.append("Run string:");
+ stdout.append("\n");
+ stdout.append(run_string);
+ stdout.append("\n");
stdout.append("App STDOUT and STDERR output:");
stdout.append("\n");
stdout.append(app_stdout);
The log output is: Exit code: 32512 Run string: env WINEPREFIX='/home/user/.wine' WINESERVER='/usr/bin/wineserver' WINELOADER='/usr/bin/wine' WINEDLLPATH='' /bin/sh -c "'/usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom'" 2>&1 App STDOUT and STDERR output: /bin/sh: /usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom: No such file or directory
The version is from Fedora 21 - q4wine-1.1-5.r2.fc21.i686
yep. I see.
/bin/sh -c "'/usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom'"
/bin/sh: /usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom: No such file or directory
/bin/sh -c "/usr/bin/fuseiso /mnt/d/Games/DidzLenkt.iso /mnt/cdrom"
Can`t open image file: No such file or directory
So the problem that there are double quotes... Let me take a look on source code.
Yeah. It seems to be safe to remove \" quotes in 378-380 lines:
run_string.append(" /bin/sh -c ");
run_string.append(script_path);
run_string.append(" 2>&1");
Fixed in trunk: https://github.com/brezerk/q4wine/commit/e3c6e5e4b01f522caf232e79856aece64b85c848
Try the solution. Reopen ticket if needed. Thanks for the bug report.
Something is still wrong. With the above patch I do not get Run string output anymore (which I added) and the log is:
Exec string:
/usr/bin/env WINEPREFIX='/home/user/.wine' WINESERVER='/usr/bin/wineserver' WINELOADER='/usr/bin/wine' WINEDLLPATH='' /bin/sh -c "cd '/mnt/ntfs/Program Files/Snowball Interactive/BigRace(Lithuanian)/' && '/usr/bin/wine' 'BG_Start.exe' 2>&1 "
Exit code:
10
App STDOUT and STDERR output:
Can't load version information. Check prefix and/or version settings.
But the iso file is mounted.
Then I clear the pre run script in the app options, and try to launch it again. The log:
Exit code:
512
Run string:
env WINEPREFIX='/home/user/.wine' WINESERVER='/usr/bin/wineserver' WINELOADER='/usr/bin/wine' WINEDLLPATH='' /bin/sh -c 2>&1
App STDOUT and STDERR output:
/bin/sh: -c: option requires an argument
The last message is a message from post mount script. It is fixed in the same commit above: https://github.com/brezerk/q4wine/commit/e3c6e5e4b01f522caf232e79856aece64b85c848 Please, try to build git head sources.
I'll try, but I see a bug in the following logic:
+ if (pre_run){
+ stdout.append("Prerun Exec string:");
+ } else {
+ stdout.append("Postrun Exec string:");
+ }
+ stdout.append("\n");
+ stdout.append(run_string);
+ stdout.append("\n");
What if both prerun and postrun exist? What if both are empty?
nope. pre and post run calsl this function separately. if pre/post run is empty, then this function will be not called at all.
With empty prerun:
Exec string:
/usr/bin/env WINEPREFIX='/home/user/.wine' WINESERVER='/usr/bin/wineserver' WINELOADER='/usr/bin/wine' WINEDLLPATH='' /bin/sh -c "cd '/mnt/ntfs/Program Files/Snowball Interactive/BigRace(Lithuanian)/' && '/usr/bin/wine' 'BG_Start.exe' 2>&1 "
Exit code:
10
App STDOUT and STDERR output:
Can't load version information. Check prefix and/or version settings.
It is on another PC than the bug was reported with, so it may be some other problem. I can run wine from command line.
If I delete /home/user/.config/q4wine, the first time wizard launches (btw, it is called First startup wizRAd, should be wizARd), in Step 3 the first 3 paths are filled, but wine libs (32 bit) and wine libs (64 bit) are empty. I fill 32 bit as /usr/lib/wine, leave 64 bit empty (my system is 32 bit), but after the wizard finishes it reports:
Error while loading application settings. wine's library path for 32 and 64 bit is not set. Please, go to the q4wine options dialog and set at least one path.
In the Options->General all the paths are empty.
hm. yeah, your configuration seems to miss WINEDLLPATH=''.
please open another issue, and add some info: wine version + a list of wine pgk's owned files on your system. thanks.
With a new source it seems OK now.
One more problem. If I put path with spaces and () in a pre run script: /usr/bin/fuseiso /mnt/ntfs/Program Files/Snowball Interactive/BigRace(Lithuanian)/DidzLenkt.iso /mnt/cdrom I get in the log:
Prerun Exec string:
env WINEPREFIX='/home/user/.wine' WINESERVER='/usr/bin/wineserver' WINELOADER='/usr/bin/wine' WINEDLLPATH='/usr/lib/wine' /bin/sh -c '/usr/bin/fuseiso /mnt/ntfs/Program Files/Snowball Interactive/BigRace(Lithuanian)/DidzLenkt.iso /mnt/cdrom' 2>&1
Exit code:
256
App STDOUT and STDERR output:
/bin/sh: -c: eilutė 0: sintaksės klaida prie netikėtos leksemos: „(“
/bin/sh: -c: eilutė 0: `/usr/bin/fuseiso /mnt/ntfs/Program Files/Snowball Interactive/BigRace(Lithuanian)/DidzLenkt.iso /mnt/cdrom'
sintaksės klaida means syntax error. If the iso file path is without spaces and (), it works.
there is nothing I can do with this :)
try to escape spaces and braces with \ i.e.:
/mnt/ntfs/Program\ Files/Snowball\ Interactive/BigRace\(Lithuanian\)/DidzLenkt.iso
or add quotes
/usr/bin/fuseiso "/mnt/ntfs/Program Files/Snowball Interactive/BigRace(Lithuanian)/DidzLenkt.iso" /mnt/cdrom
Quotes are OK, sorry forgot to try them. Thank you very much for fixing this bug.
Ur'welcome. Thanks for the reports and your help :)
I tried to add in Scripts->Pre run: /usr/bin/fuseiso /path/to/image.iso /mnt/cdrom but the image is not mounted. Although it is mounted when I execute this command in a terminal. Then I created a text file with the above command, pasted the command and made the file executable. If I add path to the script to Scripts->Pre run, it works. Could it be possible to make such mount command runnable without putting it into script?