On Mac, DOSBox ignoring the -conf command line argument

General information and assistance with DOSBox.

On Mac, DOSBox ignoring the -conf command line argument

Postby effigy345 » 2018-10-08 @ 19:56

I've been trying to figure out how to launch DOSBox with an alternative config file for some time on my Mac. I've got a few games that I want to specify an alternative keymap for and, if my understanding is correct, that can only be done by having a separate config file for these few games. Everything I can find online pertaining to DOSBox specifically skips over how to do this on Mac or gives only the vaguest of details. I've found some instructions online for adding command line arguments to an application on Mac that weren't specific to DOXBox, but I'm having trouble adapting them to DOSBox. For the longest time, I thought my arguments weren't getting passed to DOSBox, but now I understand that they are, but the "-conf" CLA (command line argument) is being ignored. If I use "-startmapper", then it works without issue. But no matter what I try, I can't get it to use a config file I specify. I've tried this from the Terminal window, and I get no errors indicating what the problem is. The command I'm using is:

/Applications/DOSBox.app/Contents/MacOS/DOSBox -conf /Users/<username>/Documents/DOSBox/DOSBox 0.74-2 Preferences

I modified it for pasting here to omit my username since its my IRL first name. Also, before running this, I copied my DOSBox config file to this place and made an alteration to the auto exec section so I can tell which config is loading. But no matter how I format this command (I tried using the "open -a" command, too), it keeps telling me:

Loading primary settings from config file /Users/<username>/Library/Preferences/DOSBox 0.74-2 Preferences

Can anyone offer some advice on how to get DOSBox to load my alternative config file?
effigy345
Newbie
 
Posts: 6
Joined: 2018-10-08 @ 19:34

Re: On Mac, DOSBox ignoring the -conf command line argument

Postby Dominus » 2018-10-08 @ 21:51

Dosbox should give you an error because it can't find the config you specify in the -conf command line. As there are spaces in the path you need to put it in quotes
/Applications/DOSBox.app/Contents/MacOS/DOSBox -conf "/Users/<username>/Documents/DOSBox/DOSBox 0.74-2 Preferences"
As it can't find /Users/<username>/Documents/DOSBox/DOSBox it falls back to the default config again
User avatar
Dominus
DOSBox Moderator
 
Posts: 7694
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: On Mac, DOSBox ignoring the -conf command line argument

Postby effigy345 » 2018-10-08 @ 23:58

Dominus wrote:Dosbox should give you an error because it can't find the config you specify in the -conf command line. As there are spaces in the path you need to put it in quotes
/Applications/DOSBox.app/Contents/MacOS/DOSBox -conf "/Users/<username>/Documents/DOSBox/DOSBox 0.74-2 Preferences"
As it can't find /Users/<username>/Documents/DOSBox/DOSBox it falls back to the default config again


Thanks for the suggestion, Dominus. When I added quotes, it didn't make a difference. For giggles, I renamed the config to remove spaces (while also leaving the quotes). For some reason that I do not understand, this worked. Thank you. I spent so much time trying to figure this out.
effigy345
Newbie
 
Posts: 6
Joined: 2018-10-08 @ 19:34

Re: On Mac, DOSBox ignoring the -conf command line argument

Postby Dominus » 2018-10-09 @ 05:01

If the quotes didn't work then you likely didn't set them correctly or something else was wrong in your path or file name. I did test this before writing here.
On the wiki you can find an AppleScript I made which lets you choose a config in ~/documents/dosbox/ to start DOSBox with.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7694
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: On Mac, DOSBox ignoring the -conf command line argument

Postby effigy345 » 2018-10-09 @ 14:40

I'm willing to accept the fact that I probably fat fingered the command the first time.

Also, I'm not seeing that command you referenced as being in the wiki. Can you specify where it is? I'd like to give it a read. Even though this problem is resolved for me, I'm still curious.
effigy345
Newbie
 
Posts: 6
Joined: 2018-10-08 @ 19:34

Re: On Mac, DOSBox ignoring the -conf command line argument

Postby Dominus » 2018-10-09 @ 15:42

It's an AppleScript, not a command at https://www.dosbox.com/wiki/Mac_OSX_Advanced
User avatar
Dominus
DOSBox Moderator
 
Posts: 7694
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: On Mac, DOSBox ignoring the -conf command line argument

Postby kode54 » 2018-10-10 @ 06:45

You can also pass arguments to macOS GUI applications by running them with the “open” command from the Terminal. Read the “open” man page, or pass it a —help. That’s supposed to be two normal hyphens, but fracking iOS won’t let me type two hyphens without automatically merging them into an em dash.
User avatar
kode54
Member
 
Posts: 257
Joined: 2003-6-15 @ 05:32


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 1 guest