VOGONS


Config file overriding

Topic actions

First post, by Serious Callers Only

User metadata
Rank Member
Rank
Member

I'm trying to do something slightly tricky, to share a ultrasound directory but at the same time sandbox the games, that is the drive containing the ultrasnd dir isn't the same drive that contains the games which each have a different conf file that only mounts their dir/cds and nothing else.

So i thought i could solve this by placing this in the main config file:
gus=true
...
ultradir=X:\ULTRASND
...
[autoexec]
mount x ~/.dosbox/gravis

and then when i invoked dosbox on the game dir autoexec section of the main config would run, mount x and then the game dir dosbox.conf autoexec section (and the others not overriden) would run and mount whatever.

However it seems that the autoexec section is not 'special' and it just replaces everything (mount x ~/.dosbox/gravis doesn't run).

Any 'easy' way to do this? Without copying or making symlinks manually and preferably in a single config file like i was hoping.

Last edited by Serious Callers Only on 2015-07-27, 21:35. Edited 1 time in total.

Reply 1 of 6, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

if you use multiple configuration files.
The settings get overridden if specified in the later configuration files.
The autoexec sections get merged together.
At least that is how it is intended to work.

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 6, by Serious Callers Only

User metadata
Rank Member
Rank
Member

Funny i just tested that. It seems it's broken. But wait a bit for me to use a clean upstream dosbox, i was temporarily using the phyisfs patch.

Reply 3 of 6, by Serious Callers Only

User metadata
Rank Member
Rank
Member

Ok i did some testing on a pristine exec.

If you just call 'dosbox' without arguments on a directory with a dosbox.conf, the primary config file will not run - no autoexec, no ultradir no nothing. Funny enough if you also set 'gus=true' on the appropriate section it takes care of initializing the ultradir with SET ULTRASND and SET ULTRADIR. But it sets them to the default.

If you call 'dosbox -conf' still in the same dir with the game conf file, it just runs it as usual.
if you call 'dosbox -userconf' it will run the primary config file but not the game dir one.

Looking at man the ticket seems to be:
dosbox -userconf -conf dosbox.conf (the game dir one, you need to specify).

It's a pity this isn't the default behavior when calling 'dosbox' without anything else when in a dir with dosbox.conf - I can't think of a time when i don't want to merge and override settings (by default) if i'm using more than one config file.

Reply 4 of 6, by Serious Callers Only

User metadata
Rank Member
Rank
Member

I also found a funny bug/user error. With this '-conf' config file:

"[autoexec]
gus=true

[autoexec]
mount c .
c:
imgmount d "CDS\DW2_CD1.ISO" "CDS\DW2_CD2.ISO" -t iso
#DWB.EXE
#exit"

invoked like this with a ~/.dosbox/dosbox-SVN.conf described in the first post: I get a error, the userconf file all goes well, until the -conf file gus line. It does it and then afterwards somehow breaks the autoexec

mount c .
c:
never happens and the
imgmount line is truncated to
z:\>_CD2.ISO" -t iso
Illegal command: _CD2.ISO"

So obviously a buffer isn't being reset properly. Maybe multiple autoexec sections should be guarded against? With [gus] everything is fine ofc.

Reply 5 of 6, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

why is there quote before the first [autoexec] section ?
please give me the full command that you use to start it

dosbox -conf 1.conf -conf 2.conf

is the intended syntax for multiple configuration files. What are you using ?

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 6, by Serious Callers Only

User metadata
Rank Member
Rank
Member
Qbix wrote:

why is there quote before the first [autoexec] section ?
please give me the full command that you use to start it

Oh no reason, it was just to indicate that it was from the file. Everything works fine. Well, except the bug.

Qbix wrote:
is the intended syntax for multiple configuration files. What are you using ? […]
Show full quote
dosbox -conf 1.conf -conf 2.conf

is the intended syntax for multiple configuration files. What are you using ?

dosbox -userconf -conf dosbox.conf

It works well, but i just found it strange that calling 'dosbox' on a dir with a dosbox.conf file will use it (which i think a good idea), but will not use the main config file, while using it on a dir without a dosbox.conf file will use the default conf file (on ~/.dosbox/dosbox-SVN.conf)

which i don't find so hot. The whole topic is a suggestion to change the default to 'will merge the default conf file and the overriding one always' and only not merge if you're using one explicitly ie: you use -conf without -userconf or -userconf without -conf (this part, i believe already happens).

Currently (in the default, 'dosbox' only case) they're exclusive based on directory which is not very predictable and doesn't work for hierarchic configs.