scummvm.ini in ScummVM root dir

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

scummvm.ini in ScummVM root dir

Post by giovpres »

Hi, may be useful to add a check, if a scummvm.ini is present in root of ScummVM dir, use it instead that in %APPDATA%\ScummVM\scummvm.ini, so if I'm using the unzipped version, I may use it in another pc without to lose games configurations (same thing with Saved games dir too), what you thing about?
User avatar
MusicallyInspired
Posts: 1136
Joined: Fri Mar 02, 2007 8:03 am
Location: Manitoba, Canada
Contact:

Re: scummvm.ini in ScummVM root dir

Post by MusicallyInspired »

I second this.
User avatar
Praetorian
ScummVM Developer
Posts: 787
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: scummvm.ini in ScummVM root dir

Post by Praetorian »

giovpres wrote: Wed Mar 10, 2021 2:53 pm Hi, may be useful to add a check, if a scummvm.ini is present in root of ScummVM dir, use it instead that in %APPDATA%\ScummVM\scummvm.ini, so if I'm using the unzipped version, I may use it in another pc without to lose games configurations (same thing with Saved games dir too), what you thing about?
For the Windows ports, GOG already uses a "portable" version of ScummVM.
It basically creates shortcuts that launch ScummVM with a custom scummvm.ini.

Code: Select all

scummvm.exe" -c "..\project_nov.ini" project-nov
The above example is for Blade Runner. The ScummVM config file is named "project_nov.ini" in this case.
The final parameter "project-nov" launches directly into the game instead of the ScummVM launcher window, so you probably can skip that part.
The example also assumes that ScummVM is in a subfolder inside the Blade Runner game folder, while the "project_nov.ini" is in the game folder itself, hence the "..".

So, perhaps something similar could also be suitable for your use case. Meaning, launching ScummVM with your config file (ini) of preference.

Keep in mind, that just copying a scummvm.ini from one PC to another will not necessarily work, as the config file stores *absolute* paths for each game folder and also save games folder (if it is custom), and any other custom defined paths (eg. "Extras").

However, there have been discussions about portable ScummVM before. A few recent ones from a quick search:
viewtopic.php?t=14804
viewtopic.php?t=15071
invwar
Posts: 67
Joined: Mon Jul 28, 2008 11:35 am

Re: scummvm.ini in ScummVM root dir

Post by invwar »

Since they moved the ini to the Appdata folder, I am using a Batch file for myself. All my ScummVM games are in D:\ScummVM. The content of ScummVM.zip I saved in D:\ScummVM\Data. I can move this everywhere I want and it will work. Only possible problematic settings are usually the Graphics Settings, as e.g. my travel laptop still operates on 900p while my Desktop uses 1440p.

The Batchfile looks like this and should be in Main ScummVM dir:

Code: Select all

Data\ScummVM.exe -c .\Data\Settings.ini
dariwonka
Posts: 17
Joined: Thu May 14, 2020 1:14 pm

Re: scummvm.ini in ScummVM root dir

Post by dariwonka »

My ScummVM its 100% portable with the games too.
I have the games inside ScummVM folder

ScummVM.bat
@echo off
start scummvm.exe --no-console -c ".\scummvm.ini"


scummvm.ini (the games are like this, expample)
[gk1-cd-win]
description=Gabriel Knight: Sins of the Fathers
extra=CD
speech_volume=60
talkspeed=255
originalsaveload=false
path=.\Gabriel Knight - Sins of the Fathers\
engineid=sci
subtitles=true
fullscreen=true
gameid=gk1
language=en
sfx_volume=60
savepath=.\Gabriel Knight - Sins of the Fathers\_saves
music_volume=157
platform=windows
enable_hq_video=true
speech_mute=false
guioptions=sndLinkSpeechToSfx gameOption2 gameOptionA lang_English


EXTRA: update.bat
mkdir temp
curl --output ./temp/update.zip https://buildbot.scummvm.org/snapshots/ ... latest.zip
powershell -command "expand-archive -force '.\temp\update.zip' '.\temp\'"
for /d %%a in (.\temp\master*) do move /Y %%a\scummvm.exe .\
for /d %%a in (.\temp\master*) do move /Y %%a\WinSparkle.dll .\
rmdir /S /q "temp"
Last edited by dariwonka on Sat May 01, 2021 6:04 am, edited 1 time in total.
giovpres
Posts: 20
Joined: Sun Jul 09, 2006 3:35 pm

Re: scummvm.ini in ScummVM root dir

Post by giovpres »

Thank you for the solution, but isn't better to place the settings.ini file into the ScummVM folder as default so just to launch the ScummVM.exe avoiding to create batch files? The batch file may be made instead to load scummvm.ini files placed in others owners pc folders (more rare situation).
dariwonka
Posts: 17
Joined: Thu May 14, 2020 1:14 pm

Re: scummvm.ini in ScummVM root dir

Post by dariwonka »

giovpres wrote: Thu Mar 18, 2021 1:13 am Thank you for the solution, but isn't better to place the settings.ini file into the ScummVM folder as default so just to launch the ScummVM.exe avoiding to create batch files? The batch file may be made instead to load scummvm.ini files placed in others owners pc folders (more rare situation).
1. The .ini is inside the scummvm folder
2. The scummvm.exe will always load %APPDATA%\ScummVM\scummvm.ini
3. If you want to use another ini, for example the one in the scummvm folder you need a .bat and as you can see, my .bat is pointing the ini inside scummvm folder.

As I said, my scummvm is 100% portable, everything: games, ini, bat are inside the same folder
invwar
Posts: 67
Joined: Mon Jul 28, 2008 11:35 am

Re: scummvm.ini in ScummVM root dir

Post by invwar »

The problem is that ScummVM always will look by default to the %Appdata% folder. So there are two solutions for this:
1. You create a batch file with the command to point to another ini file, which was already given by Praetorian, dariwonka and me. This is the easiest solution and most compatible, you can always update ScummVM whenever you like by overwriting the Exe.
2. You recompile ScummVM, and change the base directory for your ini to be always the same dir. I don't know which parts you have to change, but thats what you would need to to do if you want a clean ScummVM. But then you have to redo it every new release, which is quite tedious.
User avatar
rootfather
ScummVM Lead
Posts: 173
Joined: Tue Mar 31, 2015 11:59 am
Location: Germany
Contact:

Re: scummvm.ini in ScummVM root dir

Post by rootfather »

Hmmm. What do you folks think about something along the lines of an additional command line switch like "--portable" which will redirect all saves and the .ini file to the path where the ScummVM executable is located?
User avatar
Dark-Star
Posts: 150
Joined: Sun Oct 30, 2005 9:36 pm
Location: Reutlingen, GERMANY

Re: scummvm.ini in ScummVM root dir

Post by Dark-Star »

How about checking if an ini file exists in the current directory and launching ScummVM with that config it it is found, while falling back to the current behavior if no ini file exists?

ScummVM could start in a "portable" mode with an ini in the current directory automatically, where all new games get added automatically with a relative path instead of an absolute one
invwar
Posts: 67
Joined: Mon Jul 28, 2008 11:35 am

Re: scummvm.ini in ScummVM root dir

Post by invwar »

the portable parameter sounds actually nice, maybe you suggest this behavior in the GitHub as enhancement.

With the ini file in directory is for me actually a nice and smart idea to solve the issue we discussed. BUT the problem is, that this is not good coding style you should use for a public software. ScummVM is following Microsofts software best practices and this is totally fine to do. Using an ini in the same directory, might confuse especially not so tech savvy users and this can't be an option. So it should be only possible via Startparameter, thus .bat or a .lnk file.
Kasenshlogga
Posts: 63
Joined: Thu Jul 18, 2019 1:31 pm

Re: scummvm.ini in ScummVM root dir

Post by Kasenshlogga »

Dark-Star wrote: Fri Mar 26, 2021 8:31 pm How about checking if an ini file exists in the current directory and launching ScummVM with that config it it is found, while falling back to the current behavior if no ini file exists?

ScummVM could start in a "portable" mode with an ini in the current directory automatically, where all new games get added automatically with a relative path instead of an absolute one
I would love to see that for ScummVM. In other applications like the Dolphin emulator it does that by checking whether there's an empty "portable.txt" in the main app folder.
User avatar
Dark-Star
Posts: 150
Joined: Sun Oct 30, 2005 9:36 pm
Location: Reutlingen, GERMANY

Re: scummvm.ini in ScummVM root dir

Post by Dark-Star »

invwar wrote: Sat Mar 27, 2021 5:47 am the portable parameter sounds actually nice, maybe you suggest this behavior in the GitHub as enhancement.

With the ini file in directory is for me actually a nice and smart idea to solve the issue we discussed. BUT the problem is, that this is not good coding style you should use for a public software. ScummVM is following Microsofts software best practices and this is totally fine to do. Using an ini in the same directory, might confuse especially not so tech savvy users and this can't be an option. So it should be only possible via Startparameter, thus .bat or a .lnk file.
For the non-tech-savvy user, running a BAT file that adds that parameter (instead of just running the EXE file, like they're used to) is probably even more confusing, that's why a solution that doesn't require any special parameter is IMHO the better way.

Also, Microsoft's software best practices don't apply to portable software, as that's the reason people use portable software in the first place :-)
invwar
Posts: 67
Joined: Mon Jul 28, 2008 11:35 am

Re: scummvm.ini in ScummVM root dir

Post by invwar »

Sure, but ScummVM is since years not anymore a portable software per se. The Windows Installer is the official preferred method. But I definitely would also like to have the "Zipfile" version declared as fully portable.
User avatar
Dark-Star
Posts: 150
Joined: Sun Oct 30, 2005 9:36 pm
Location: Reutlingen, GERMANY

Re: scummvm.ini in ScummVM root dir

Post by Dark-Star »

invwar wrote: Sat Apr 03, 2021 2:06 pm Sure, but ScummVM is since years not anymore a portable software per se. The Windows Installer is the official preferred method. But I definitely would also like to have the "Zipfile" version declared as fully portable.
ScummVM is perfectly portable. You just need the EXE file and some DLLs. Even better: If you compile it yourself you can get a single EXE file that runs without any DLLs at all, this is how I've been setting up a portable version of ScummVM.

The installer is just convenience, no system files or anything else needs to be "installed" outside the ScummVM install dir.
Post Reply