Page 1 of 1

Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 13:00
by zwzsg
I am trying to make it so:
- All the Spring .exe, .dll, .sd7, and other files that don't change be in one folder
- All the settings, lua config, demos, and other files that change be in another folder ../../Data/

I managed to make Spring.exe itself obey this, by using both the environnment variable SPRING_DATADIR and the commandline option --config

I was a bit annoyed that relative path isn't supported, but then I expanded the pathes and now it works: I ran Spring and not a single file in the folder where the engine is gets changed, all the generated files go into ../../Data/

But only for single player with stock settings!









So now I moved on to trying to do the same for springsettings.exe (next will be multiplayer lobby):
  • I tried to run SpringSettings.exe with the --config commandline option. There was a popup explaining me it is not one of the valid SpringSettings.exe option.
  • I set up the environnement variable SPRING_DATADIR. SpringSettings.exe ignored it.
  • I called SpringSettings.exe with the current path set to another folder. SpringSettings complained it couldn't find its .dlls.

I was also surprised to see running SpringSettings not only touch up springsettings.cfg, but also creates ArchiveCacheV7.lua and unitsync.log. Why would SpringSettings.exe need to scan the mods & maps?




Henceforth, feature request:
  • Make SpringSettings.exe uses the --config commandline argument like Spring.exe does
  • Make SpringSettings.exe not create or modify any other files that the one passed with the --config argument.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 13:04
by koshi
SpringSettings does not modify any file but it's own config. Everything else is unitsync. As for the --config option, make a feature request in the cirrect place and I might remember that some time.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 13:13
by zwzsg
1) Which would be the correct place? Spring's Mantis or SpringLobby's Redmine?

2) Why does SpringSettings.exe call unitsync anyway?

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 13:56
by koshi
1) springlobby's redmine
2) to get/set settings

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 14:03
by zwzsg
Ah. So SpringSettings does not open the .cfg itself, it relies on unitsync to find and parse it?

If so, then unitsync would need to support a parameter to indicate where the springsettings.cfg file is as well.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 14:19
by Auswaschbar
zwzsg wrote:Ah. So SpringSettings does not open the .cfg itself, it relies on unitsync to find and parse it?

If so, then unitsync would need to support a parameter to indicate where the springsettings.cfg file is as well.

Code: Select all

EXPORT(void        ) SetSpringConfigFile(const char* filenameAsAbsolutePath);
EXPORT(const char* ) GetSpringConfigFile();
I guess it does what the name suggests.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 14:23
by zwzsg
I assume Auswaschbar post is about how unitsync interface already support custom springsettings.cfg locations.


Loosely related is the issue of making sure unitsync, SpringLobby, SpringSettings, all inherit the environment variables table of whoever run them, and all make good use of the SPRING_DATADIR environnment variable, if only to know which folder to generate unitsync.log and ArchiveCacheV7.lua into.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 14:26
by Auswaschbar
zwzsg wrote:I assume Auswaschbar post is about how unitsync interface already support custom springsettings.cfg locations.


Loosely related is the issue of making sure unitsync, SpringLobby, SpringSettings, all inherit the environment variables table of whoever run them, and all make good use of the SPRING_DATADIR environnment variable, if only to know which folder to generate unitsync.log and ArchiveCacheV7.lua into.
Putting it as "SpringData=..." in the config file might be a better idea, cause it will always work when the config file is read..

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 14:30
by zwzsg
Well, except that relative pathes are not allowed, so I would need my launcher to constantly check and correct the SpringData entry in the settings to make the whole thing portable.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 20:23
by lurker
So get the person making this change to add support for relative paths.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 18 Mar 2010, 21:17
by zwzsg
I can do without relative path, if unitsync, springsettings, and lobbies respect the SPRING_DATADIR environment variable and pass it to each others.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 19 Mar 2010, 08:52
by hoijui
if the lobbies would need/use env var (directly), they would be doing something wrong. spring and unitsync both use the same C++ class (rts/System/FileSystem/DataDirLocater.cpp) to assemble the data-dirs. this is also where the env var is read. i made some fixes to this class, which are in spring master, but they are only relevant if spring.exe and unitsync.dll are not in the same directory. if they are, then unitsync and spring should already generate equal lists of data-dirs (given they get the same env var).
The lobby could either have their own way of setting cache/log/settings dirs, or query the writeable data dir through unitsync.

Re: Telling springsettings.exe where springsettings.cfg is

Posted: 19 Mar 2010, 10:30
by zwzsg
Edit: Sorry, I was wrong, setting the environment variable works well.

There's still the issues of passing the path to springsettings.cfg

Also I noticed SpringLobby still store chat logs in the engine folder and not in the data folder.