Telling springsettings.exe where springsettings.cfg is

Telling springsettings.exe where springsettings.cfg is

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Telling springsettings.exe where springsettings.cfg is

Post 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.
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Re: Telling springsettings.exe where springsettings.cfg is

Post by zwzsg »

1) Which would be the correct place? Spring's Mantis or SpringLobby's Redmine?

2) Why does SpringSettings.exe call unitsync anyway?
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Telling springsettings.exe where springsettings.cfg is

Post by koshi »

1) springlobby's redmine
2) to get/set settings
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Telling springsettings.exe where springsettings.cfg is

Post 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..
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Telling springsettings.exe where springsettings.cfg is

Post by lurker »

So get the person making this change to add support for relative paths.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Re: Telling springsettings.exe where springsettings.cfg is

Post 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.
Post Reply

Return to “Feature Requests”

cron