Youda008 / DoomRunner

Preset-oriented graphical launcher of various ported Doom engines (an alternative to ZDL)
GNU General Public License v3.0
205 stars 13 forks source link

Additional command line arguments are not quoted properly #103

Closed c0wg0d closed 1 year ago

c0wg0d commented 1 year ago

I am trying to create a preset that plays the Doom done Quick demo file. My Additional command line arguments is -playdemo "../../Demos/Doom done Quick/DDQ-EP1.LMP". When I try to launch with this, I get the error W_GetNumForName: "../../D not found! It seems like the quotes are lost or are wrapped inside other quotes upon launch which messes up the command. If I run this from the command line outside of Doom Runner it works fine:

chocolate-doom.exe -iwad "../../IWADs/Doom/DOOM.WAD" -playdemo "../../Demos/Doom done Quick/DDQ-EP1.LMP"

My folder structure is as follows:

Doom\IWADs\Doom\DOOM.WAD
Doom\Source Ports\Chocolate Doom\chocolate-doom.exe
Doom\Demos\Doom done Quick\DDQ-EP1.LMP
Sohl42 commented 1 year ago

Using additional command line arguments without quotes around the path seems to work out. For example: -playdemo ../../Demos/ep1-513.lmp Resulting in: ./dsda-doom.exe -iwad "../../IWADS/DOOM.WAD" -playdemo ../../Demos/ep1-513.lmp

Edit: Oh right, only works for paths with no space. So any paths with spaces are still an issue.

c0wg0d commented 1 year ago

Yeah, spaces cause an issue, but you're right that if your path has no spaces, omitting the quotes does work. I would still like to see this bug get fixed though, if anyone is still maintaining this project.

Youda008 commented 1 year ago

Hm, this is tricky. Either Qt or Windows automatically adds quotes around parameters that contain spaces and automatically escape manually added quotes with backslash, resulting in command containing -playdemo \"../../Demos/Doom done Quick/DDQ-EP1.LMP\" which the Chocolate Doom apparently can't handle. These problems with quoting are never-ending story (i already reworked the quoting mechanisms several times) because Windows behaves differently than Linux and it's really hard to write a code that works for both and is not a complete mess. But i'm not giving up yet.

Youda008 commented 1 year ago

Should be fixed now.