Page 1 of 2
Linux style settings under windows
Posted: 24 Nov 2006, 11:42
by AF
Could it be possible to allow windows users to use the config file that Linux users have rather than the registry? It wouldn't require much to change, and it would allow proper portable copies of spring on usb and CD/DVD.
Posted: 24 Nov 2006, 16:52
by Michilus_nimbus
Agree.
Posted: 24 Nov 2006, 20:31
by Kloot
+1 for minimizing registry dependence, but I seriously don't envy whoever'll get chosen to rewrite the source for the settings tool.

Posted: 25 Nov 2006, 15:22
by PauloMorfeo
Windows Registry for the loose.
Posted: 25 Nov 2006, 19:21
by AF
A tdf file type replacement wouldnt require all that much effort tbh.
Is the linux config TDF or just a textfile of this=that this=that etc?
Posted: 25 Nov 2006, 20:02
by Tobi
Just a variable=value textfile.
Posted: 25 Nov 2006, 20:59
by AF
ah, that'd be easy. Just yank the code in spring in confighandler.cpp out, and make the settings app call that instead of registry calls..
Posted: 25 Nov 2006, 21:09
by trepan
It isn't difficult to do, but you've missed something important: where to put the
config file? You'll probably want to have different config files for different users on
the same machine, but Windows does not have the same concept of $HOME as
does unix. A call to SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &idlist)
and SHGetPathFromIDList(idlist, dir) with an appended directory will probably do the
trick. I've also heard of there being problems using that location for when user dirs are
on network shares, but I forget the details (gladly, as I have no love for windows code

)
Posted: 25 Nov 2006, 22:49
by AF
For XP:
Code: Select all
%HOMEDRIVE%%HOMEPATH%\My Documents
or
Code: Select all
c:\Documents and Settings\%username%\My Documents
Also, should work on XP:
Code: Select all
int Result;
char pPath[512];
LPITEMIDLIST pIDL = NULL;
Result = SHGetSpecialFolderLocation( (HWND)100, 0x5, &pIDL );
if ( Result == 0 ){
Result = SHGetPathFromIDList(pIDL, pPath);
}
That way you'd load and save from a spring folder in my documents.... It might also be useful for the lobby to save logs there too.
Tho preferably I'd like to be able to tell spring to load from the spring folder....
also for a windows 98 and above compliant method:
http://msdn.microsoft.com/library/defau ... erpath.asp
Actualy if you ever want to have the windows xp logo on your product you MUST save your savegames inside the Documents and settings/application data folder otherwise microsoft will not qualify it as an nice windows application.
Posted: 25 Nov 2006, 23:36
by ZellSF
AF wrote:For XP:
Code: Select all
%HOMEDRIVE%%HOMEPATH%\My Documents
or
Code: Select all
c:\Documents and Settings\%username%\My Documents
Also, should work on XP:
why not just use %userprofile% ? I'm sure %mydocuments% or some other variable for My Documents is ebing added in Vista.
Posted: 26 Nov 2006, 03:22
by AF
we cant expect spring users to upgrade to vista.
Besides, the method linked ot by the msdn site seems to be the way togo, and doesnt require us to lookup the environment variables before passing them to the loading code.
Posted: 26 Nov 2006, 14:40
by MadRat
Bah, just save it in the Spring folder under Spring\config\~username and be done with it. That way your portable copy also carries the configs for each user.
Posted: 26 Nov 2006, 15:18
by Kloot
Indeed, have it be as self-contained as possible so the only API-call needed is to get the username; that way you also eliminate up-front any issues with '98 and Vista storing userdata in different places etc.
Posted: 27 Nov 2006, 06:35
by Ling_Lover
but if it's on a CD then you cant save it in spring's directory...
Posted: 27 Nov 2006, 06:46
by Forboding Angel
Ling_Lover wrote:but if it's on a CD then you cant save it in spring's directory...
a 8 gig harddrive will only cost you 5 - 10 bucks.
get the hell outta here.
Re: Linux style settings under windows
Posted: 27 Nov 2006, 06:59
by Ling_Lover
AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
i dont play it on a CD, but thats what the OP suggested...
Re: Linux style settings under windows
Posted: 27 Nov 2006, 09:49
by Forboding Angel
Ling_Lover wrote:AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
i dont play it on a CD, but thats what the OP suggested...
read again.
he was talking about copying your spring to a dvd and taking it with you so that you could copy it onto another machine and play off of that, or inversely, you could have it all set up and play from the dvd anywhere.
The point is Registry independance, and it's a damn good idea.
Posted: 27 Nov 2006, 11:22
by Dragon45
Put it on a virtual machine.
http://www.vmware.com
VMServer should do the trick; if not, VMWorkstation may be "bought" very easily.
Re: Linux style settings under windows
Posted: 27 Nov 2006, 11:24
by Ling_Lover
Forboding Angel wrote:Ling_Lover wrote:AF wrote:... and it would allow proper portable copies of spring on usb and CD/DVD.
i dont play it on a CD, but thats what the OP suggested...
read again.
he was talking about copying your spring to a dvd and taking it with you so that you could copy it onto another machine and play off of that, or inversely, you could have it all set up and play from the dvd anywhere.
The point is Registry independance, and it's a damn good idea.
I read it fine the first time, and don't see how he implied what you are saying that he was talking about...
but i do agree, it is a good idea to get away from the registry
Posted: 27 Nov 2006, 13:46
by AF
yuk, I have no intention of trying to use vmware.
I'm not running spring in a program I have to reboot to install only to find that C drive has been reset back to a pre-stored cache making it impossible to use.
And I ain't lugging around another 4GB of virtual HD, after spending several hours installing XP to it.
All the code to load and save to the spring directory is already in place and just needs moving around, the only new stuff needed would be the call to retrieve the windows user name.